[GTK] HTTP auth dialog incorrectly rendered with Accelerated Compositing enabled
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2016 16:40:14 +0000 (16:40 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2016 16:40:14 +0000 (16:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154159

Reviewed by Michael Catanzaro.

There are two problems here, first we are changing the cairo
operator when rendering the xcomposite window pixmap without a
proper save/restore, so it affects the drawing that happens after
that, and second problem is that we are not rendering the gray
background in AC mode because we are returning earlier.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewRenderAcceleratedCompositingResults):
(webkitWebViewBaseDraw):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196475 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp

index 3e49a4d..6b52bf6 100644 (file)
@@ -1,3 +1,20 @@
+2016-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] HTTP auth dialog incorrectly rendered with Accelerated Compositing enabled
+        https://bugs.webkit.org/show_bug.cgi?id=154159
+
+        Reviewed by Michael Catanzaro.
+
+        There are two problems here, first we are changing the cairo
+        operator when rendering the xcomposite window pixmap without a
+        proper save/restore, so it affects the drawing that happens after
+        that, and second problem is that we are not rendering the gray
+        background in AC mode because we are returning earlier.
+
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewRenderAcceleratedCompositingResults):
+        (webkitWebViewBaseDraw):
+
 2016-02-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         [GTK] Allow applications to disable Accelerated Compositing mode.
index 69e592c..e5f0759 100644 (file)
@@ -528,15 +528,14 @@ static void webkitWebViewBaseConstructed(GObject* object)
     priv->authenticationDialog = 0;
 }
 
-#if USE(TEXTURE_MAPPER)
 static bool webkitWebViewRenderAcceleratedCompositingResults(WebKitWebViewBase* webViewBase, DrawingAreaProxyImpl* drawingArea, cairo_t* cr, GdkRectangle* clipRect)
 {
+#if USE(TEXTURE_MAPPER) && USE(REDIRECTED_XCOMPOSITE_WINDOW)
     ASSERT(drawingArea);
 
     if (!drawingArea->isInAcceleratedCompositingMode())
         return false;
 
-#if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     // To avoid flashes when initializing accelerated compositing for the first
     // time, we wait until we know there's a frame ready before rendering.
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
@@ -547,10 +546,12 @@ static bool webkitWebViewRenderAcceleratedCompositingResults(WebKitWebViewBase*
     priv->redirectedWindow->resize(drawingArea->size());
 
     if (cairo_surface_t* surface = priv->redirectedWindow->surface()) {
+        cairo_save(cr);
         cairo_rectangle(cr, clipRect->x, clipRect->y, clipRect->width, clipRect->height);
         cairo_set_source_surface(cr, surface, 0, 0);
         cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
         cairo_fill(cr);
+        cairo_restore(cr);
     }
 
     return true;
@@ -561,7 +562,6 @@ static bool webkitWebViewRenderAcceleratedCompositingResults(WebKitWebViewBase*
     return false;
 #endif
 }
-#endif
 
 static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr)
 {
@@ -574,13 +574,10 @@ static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr)
     if (!gdk_cairo_get_clip_rectangle(cr, &clipRect))
         return FALSE;
 
-#if USE(TEXTURE_MAPPER)
-    if (webkitWebViewRenderAcceleratedCompositingResults(webViewBase, drawingArea, cr, &clipRect))
-        return GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->draw(widget, cr);
-#endif
-
-    WebCore::Region unpaintedRegion; // This is simply unused.
-    drawingArea->paint(cr, clipRect, unpaintedRegion);
+    if (!webkitWebViewRenderAcceleratedCompositingResults(webViewBase, drawingArea, cr, &clipRect)) {
+        WebCore::Region unpaintedRegion; // This is simply unused.
+        drawingArea->paint(cr, clipRect, unpaintedRegion);
+    }
 
     if (webViewBase->priv->authenticationDialog) {
         cairo_set_operator(cr, CAIRO_OPERATOR_OVER);