mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 11:39:44 +03:00
WindowServer: Don't reallocate the cursor back bitmap all the time in HighDPI mode
It's in efficient, and it also meant we wouldn't reallocate a bigger backing bitmap in a lowdpi->highdpi transition, leading to minor drawing glitches after such a transition. (Whoops!)
This commit is contained in:
parent
476a3acfb2
commit
248d75e13b
Notes:
sideshowbarker
2024-07-18 23:48:17 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/248d75e13b6 Pull-request: https://github.com/SerenityOS/serenity/pull/4961 Reviewed-by: https://github.com/awesomekling
@ -802,8 +802,9 @@ void Compositor::draw_cursor(const Gfx::IntRect& cursor_rect)
|
||||
{
|
||||
auto& wm = WindowManager::the();
|
||||
|
||||
if (!m_cursor_back_bitmap || m_cursor_back_bitmap->size() != cursor_rect.size()) {
|
||||
m_cursor_back_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, cursor_rect.size() * Screen::the().scale_factor());
|
||||
auto physical_cursor_size = cursor_rect.size() * Screen::the().scale_factor();
|
||||
if (!m_cursor_back_bitmap || m_cursor_back_bitmap->size() != physical_cursor_size) {
|
||||
m_cursor_back_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, physical_cursor_size);
|
||||
m_cursor_back_painter = make<Gfx::Painter>(*m_cursor_back_bitmap);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user