1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 21:07:34 +00:00

WindowServer: Fix flickering

Rather than blitting and rendering each window every time, only
render what actually changed. And while doing so, only render
the portions that are visible on the screen. This avoids flickering
because flipping framebuffers isn't always perfectly in sync with
the code, so it's possible that the flip happens slightly delayed
and we can briefly see the next iteration having partially completed.

Also, avoid touching the mouse cursor unless it is in an area that
needs updating. This reduces flickering unless it is over an area
that is updated often. And because we no longer render the entire
screen, we'll save the contents below the cursor so that we can
hide it before touching that area.

Fixes #2981
This commit is contained in:
Tom 2020-08-17 22:45:10 -06:00 committed by Andreas Kling
parent f8903acea2
commit a698a58d3c
11 changed files with 679 additions and 186 deletions

View file

@ -47,6 +47,7 @@ public:
void on_mouse_event(const MouseEvent&);
void notify_window_rect_changed(const Gfx::IntRect& old_rect, const Gfx::IntRect& new_rect);
void invalidate_title_bar();
void invalidate(Gfx::IntRect relative_rect);
Gfx::IntRect title_bar_rect() const;
Gfx::IntRect title_bar_icon_rect() const;