From a55cf08ef92284954cfe3c64b98ea276c68a00c7 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 27 Jun 2021 15:43:04 -0600 Subject: WindowServer: Fix regression flushing scaled displays This accidentally was broken by 38af4c29e --- Userland/Services/WindowServer/Compositor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Services/WindowServer/Compositor.cpp b/Userland/Services/WindowServer/Compositor.cpp index 554895eee6..ac28b4315b 100644 --- a/Userland/Services/WindowServer/Compositor.cpp +++ b/Userland/Services/WindowServer/Compositor.cpp @@ -568,9 +568,9 @@ void Compositor::flush(Screen& screen) // Almost everything in Compositor is in logical coordinates, with the painters having // a scale applied. But this routine accesses the backbuffer pixels directly, so it // must work in physical coordinates. - rect = rect * screen.scale_factor(); - Gfx::RGBA32* front_ptr = screen_data.m_front_bitmap->scanline(rect.y()) + rect.x(); - Gfx::RGBA32* back_ptr = screen_data.m_back_bitmap->scanline(rect.y()) + rect.x(); + auto scaled_rect = rect * screen.scale_factor(); + Gfx::RGBA32* front_ptr = screen_data.m_front_bitmap->scanline(scaled_rect.y()) + scaled_rect.x(); + Gfx::RGBA32* back_ptr = screen_data.m_back_bitmap->scanline(scaled_rect.y()) + scaled_rect.x(); size_t pitch = screen_data.m_back_bitmap->pitch(); // NOTE: The meaning of a flush depends on whether we can flip buffers or not. @@ -593,8 +593,8 @@ void Compositor::flush(Screen& screen) from_ptr = back_ptr; } - for (int y = 0; y < rect.height(); ++y) { - fast_u32_copy(to_ptr, from_ptr, rect.width()); + for (int y = 0; y < scaled_rect.height(); ++y) { + fast_u32_copy(to_ptr, from_ptr, scaled_rect.width()); from_ptr = (const Gfx::RGBA32*)((const u8*)from_ptr + pitch); to_ptr = (Gfx::RGBA32*)((u8*)to_ptr + pitch); } -- cgit v1.2.3