From 463dc91049e02ddc99843566f663a0ee16eaf212 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 5 Apr 2022 17:22:54 +0200 Subject: [PATCH] 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. :^) --- Userland/Services/WebContent/ConnectionFromClient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index 803b8941c5..4798233a19 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -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)