[Webkit-unassigned] [Bug 245767] New: web view is flipped when using soft rendering under wayland

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 27 23:02:28 PDT 2022


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

            Bug ID: 245767
           Summary: web view is flipped when using soft rendering under
                    wayland
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: dominique.martinet at atmark-techno.com
                CC: bugs-noreply at webkitgtk.org

When using soft rendering under wayland, the web view is flipped.

I unfortunately cannot take screenshots easily in this configuration but it's really just that: menu etc all are correct and the web page itself is flipped, with links at their original position, that makes navigation quite interesting...

I believe this is just a follow-up on https://bugs.webkit.org/show_bug.cgi?id=218354 which was fixed in this commit for the GL happy path:
https://github.com/WebKit/WebKit/commit/e8c1de325def48890596add0ca6c5f756b7308b9 ("[GTK4] WebView is flipped https://bugs.webkit.org/show_bug.cgi?id=218354")

My problem is that I did not use the happy path ("GDK is not able to create a GL context, falling back to glReadPixels (slow!)" message) and going through the other flipping path that did not get removed...

I did not understand why it was added in the first place, or where it might be required at all -- my setup is on debian stable with cairo 1.16.0 and pangocairo 1.46.2. Since that also affected the happy GTK4 path I believe new versions also will agree with me.

FWIW I since fixed GL as well, and that works both with and without this patch; but might as well get this right:

```
diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp
index 631649923730..88541f326368 100644
--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp
+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp
@@ -605,11 +605,6 @@ bool AcceleratedBackingStoreWayland::paint(cairo_t* cr, const IntRect& clipRect)
         RELEASE_ASSERT_NOT_REACHED();
     }

-    // The compositor renders the texture flipped for gdk_cairo_draw_from_gl, fix that here.
-    cairo_matrix_t transform;
-    cairo_matrix_init(&transform, 1, 0, 0, -1, 0, cairo_image_surface_get_height(m_surface.get()) / m_webPage.deviceScaleFactor());
-    cairo_transform(cr, &transform);
-
     cairo_rectangle(cr, clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height());
     cairo_set_source_surface(cr, m_surface.get(), 0, 0);
     cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
```

I'll try to submit a PR with that.

-- 
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/20220928/d3a732e2/attachment.htm>


More information about the webkit-unassigned mailing list