Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f7505306416230e85964dc95c1e20ba30ee3e254
https://github.com/WebKit/WebKit/commit/f7505306416230e85964dc95c1e20ba30ee3e254
Author: Thomas Devoogdt <[email protected]>
Date: 2026-09-22 (Tue, 22 Sep 2026)
Changed paths:
M Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp
M Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h
Log Message:
-----------
[GTK3] Invalidate only the damaged area of the web view
https://bugs.webkit.org/show_bug.cgi?id=324546
Reviewed by Carlos Garcia Campos.
AcceleratedBackingStore invalidates the whole view widget every time a frame
is ready, and the damage rects that come with the frame are only consumed by
the GTK4 code paths, which hand them to the GdkMemoryTextureBuilder or the
GdkDmabufTextureBuilder. On GTK3 the rects are dropped, so every frame makes
GTK repaint and upload the complete view instead of the part that changed.
That is expensive for the shared memory buffers used when there is no
hardware acceleration, because the committed buffer is painted with cairo into
the X window: a full sized image surface is composited and pushed to the X
server for every frame, even when the frame carries no damage at all. On a low
end device this makes plain pointer motion over a page that renders nothing
saturate the X server.
Use the pending damage to invalidate the view per rect on GTK3.
webkitWebViewBaseDraw() already takes the clip rectangle from the cairo
context and passes it down to AcceleratedBackingStore::paint(), so a partial
invalidation directly reduces the area that is composited and uploaded. The
whole widget is still invalidated when there is no damage, or when there is no
committed buffer yet and the view therefore has nothing valid on screen.
* Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp:
(WebKit::AcceleratedBackingStore::AcceleratedBackingStore):
(WebKit::AcceleratedBackingStore::queuePendingDamageDraw):
* Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h:
Signed-off-by: Thomas Devoogdt <[email protected]>
Canonical link: https://commits.webkit.org/321589@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications