Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[GTK4] WebView is flipped
https://bugs.webkit.org/show_bug.cgi?id=218354

Reviewed by Adrian Perez de Castro.

Stop painting y-flipped textures when buildig with GTK4.

* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::snapshot):
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h:

Canonical link: https://commits.webkit.org/231411@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Nov 10, 2020
1 parent 43b4f1a commit e8c1de3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
13 changes: 13 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,16 @@
2020-11-10 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK4] WebView is flipped
https://bugs.webkit.org/show_bug.cgi?id=218354

Reviewed by Adrian Perez de Castro.

Stop painting y-flipped textures when buildig with GTK4.

* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::snapshot):
* WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h:

2020-11-10 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Crash in WebKit::DropTarget::drop
Expand Down
Expand Up @@ -552,12 +552,6 @@ void AcceleratedBackingStoreWayland::snapshot(GtkSnapshot* gtkSnapshot)

graphene_rect_t bounds = GRAPHENE_RECT_INIT(0, 0, static_cast<float>(cairo_image_surface_get_width(m_surface.get())), static_cast<float>(cairo_image_surface_get_height(m_surface.get())));
RefPtr<cairo_t> cr = adoptRef(gtk_snapshot_append_cairo(gtkSnapshot, &bounds));

// The compositor renders the texture flipped for gdk, 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.get(), &transform);

cairo_set_source_surface(cr.get(), m_surface.get(), 0, 0);
cairo_set_operator(cr.get(), CAIRO_OPERATOR_OVER);
cairo_paint(cr.get());
Expand Down
Expand Up @@ -46,7 +46,7 @@ class AcceleratedSurfaceLibWPE final : public AcceleratedSurface {
void clientResize(const WebCore::IntSize&) override;
bool shouldPaintMirrored() const override
{
#if PLATFORM(GTK)
#if PLATFORM(GTK) && !USE(GTK4)
return true;
#else
return false;
Expand Down

0 comments on commit e8c1de3

Please sign in to comment.