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

WebContent: Cancel pending paint requests when removing a backing store

If there are pending paint requests waiting to be processed when the
client asks us to remove a backing store, we now prune them from the
request queue.

This avoids doing completely wasted painting work while resizing the
browser window. :^)
This commit is contained in:
Andreas Kling 2022-04-05 17:22:54 +02:00
parent b28beb691e
commit 463dc91049

View file

@ -109,6 +109,7 @@ void ConnectionFromClient::add_backing_store(i32 backing_store_id, Gfx::Shareabl
void ConnectionFromClient::remove_backing_store(i32 backing_store_id)
{
m_backing_stores.remove(backing_store_id);
m_pending_paint_requests.remove_all_matching([backing_store_id](auto& pending_repaint_request) { return pending_repaint_request.bitmap_id == backing_store_id; });
}
void ConnectionFromClient::paint(Gfx::IntRect const& content_rect, i32 backing_store_id)