[Webkit-unassigned] [Bug 252648] New: [GTK] GtkSnapshot contains overly large damage area

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 20 21:31:08 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=252648

            Bug ID: 252648
           Summary: [GTK] GtkSnapshot contains overly large damage area
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: christian at hergert.me
                CC: bugs-noreply at webkitgtk.org

Hi!

I'm the author of a good portion of GTK 4's GL renderer. I wanted to chime in on some implementation details that might allow for improving snapshot performance of the GTK WebKitWebView when using EGL.

Currently, when using WebKit's accelerated rendering with the GTK 4 backend, an EGL texture is imported into GDK and snapshotted.

The unfortunate bit is that there is no damaged associated with the texture (as textures in GDK are considered "immutable"). What that means is when the GskRenderNode tree is snapshotted, it will perform a diff to the previous frame to determine damage. The single texture node currently added to the snapshot will be different, causing the damage rectangle to match the entire bounds of the texture area.

That means if you have a 16x16 GIF animating, you'll still redraw the entire browser window as far as the desktop compositor is concerned.

While I haven't looked to see what texture sharing mechanism is being used under the hood, I suspect it's a DMABUF attached to a GL texture? If so, one possible way to improve this is to keep 2 textures around (mapped to the same DMABUF). If you snapshot as tiles of textures (say 128x128) you only need to "flip" the tile which intersects the underlying damage. That is enough for "gsk_render_node_diff()" to see the damage.

I have some example code doing this in libmks https://gitlab.gnome.org/chergert/libmks/-/blob/main/lib/mks-dmabuf-paintable.c which could serve as an example.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230221/f4ecae46/attachment-0001.htm>


More information about the webkit-unassigned mailing list