1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

LibWeb: Paint page only if something that requires repaint happened

Resolves a performance regression from
8ba18dfd40, where moving paint scheduling
to `EventLoop::process()` led to unnecessary repaints.

This update introduces a flag to trigger repaints only when necessary,
addressing the issue where repaints previously occurred with each event
loop process, irrespective of actual changes.
This commit is contained in:
Aliaksandr Kalenik 2024-02-23 22:10:35 +01:00 committed by Andreas Kling
parent 906ac71eca
commit c3f5dbb101
4 changed files with 15 additions and 4 deletions

View file

@ -173,6 +173,8 @@ public:
[[nodiscard]] TargetSnapshotParams snapshot_target_snapshot_params();
[[nodiscard]] bool needs_repaint() const { return m_needs_repaint; }
struct PaintConfig {
bool paint_overlay { false };
bool should_show_line_box_borders { false };
@ -221,6 +223,8 @@ private:
CSSPixelSize m_size;
CSSPixelPoint m_viewport_scroll_offset;
bool m_needs_repaint { false };
};
HashTable<Navigable*>& all_navigables();