mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:58:12 +00: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
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue