1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +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

@ -222,7 +222,6 @@ void PageClient::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& ta
void PageClient::set_viewport_rect(Web::DevicePixelRect const& rect)
{
page().top_level_traversable()->set_viewport_rect(page().device_to_css_rect(rect));
Web::HTML::main_thread_event_loop().schedule();
}
void PageClient::page_did_invalidate(Web::CSSPixelRect const&)