1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:57:35 +00:00

WebContent: Coalesce paint invalidations to avoid spamming client

Some content cause a lot of paint invalidations (e.g someone drawing to
a <canvas> repeatedly) and we don't need to spam the client about this.
Instead, accumulate a dirty rect, and send it once per event loop step.
This commit is contained in:
Andreas Kling 2021-09-28 22:53:59 +02:00
parent 82af69376b
commit 651f30dfbe
2 changed files with 11 additions and 2 deletions

View file

@ -72,6 +72,9 @@ private:
RefPtr<Gfx::PaletteImpl> m_palette_impl;
Gfx::IntRect m_screen_rect;
bool m_should_show_line_box_borders { false };
RefPtr<Core::Timer> m_invalidation_coalescing_timer;
Gfx::IntRect m_invalidation_rect;
};
}