1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:47:36 +00:00

WindowServer: Prevent some overdraw by the window geometry overlay

While the window geometry overlay is centered inside the tile overlay
neither the text nor the location change, so there is no need to
re-render and update it every time the window moves.
This commit is contained in:
Tom 2023-04-04 10:32:37 -06:00 committed by Linus Groh
parent 5a73691fe9
commit e1077ebbad
2 changed files with 41 additions and 32 deletions

View file

@ -151,13 +151,24 @@ public:
void start_or_stop_move_to_tile_overlay_animation(TileWindowOverlay*);
private:
void update_rect();
WeakPtr<Window> m_window;
DeprecatedString m_label;
Gfx::IntRect m_label_rect;
Gfx::IntRect m_ideal_overlay_rect;
struct UpdateState {
Gfx::IntRect geometry;
bool is_for_tile_overlay;
bool operator==(UpdateState const& other) const
{
if (this == &other)
return true;
return geometry == other.geometry && is_for_tile_overlay == other.is_for_tile_overlay;
}
};
UpdateState m_last_updated;
struct {
RefPtr<Animation> animation;
float progress { 0.0f };