diff options
author | Tom <tomut@yahoo.com> | 2021-06-27 15:43:04 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-28 16:40:15 +0200 |
commit | a55cf08ef92284954cfe3c64b98ea276c68a00c7 (patch) | |
tree | 07832808289831fa937607fd1e6cad16067cfb70 | |
parent | 4c8f7113ff9d1e5c99f02fa80f31c890a5071f1d (diff) | |
download | serenity-a55cf08ef92284954cfe3c64b98ea276c68a00c7.zip |
WindowServer: Fix regression flushing scaled displays
This accidentally was broken by 38af4c29e
-rw-r--r-- | Userland/Services/WindowServer/Compositor.cpp | 10 |
1 files 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); } |