Title: [178502] releases/WebKitGTK/webkit-2.6/Source
Revision
178502
Author
[email protected]
Date
2015-01-15 02:33:46 -0800 (Thu, 15 Jan 2015)

Log Message

Merge r178414 - [GTK] Do not resize the redirected XComposite window when not in accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=140353

Reviewed by Martin Robinson.

We create the redirected XComposite window unconditionally, but
with a size of 1x1 to save memory. However, we are always resizing
it, so in the end we always end up with a XWindow allocated for
the same size of the web view, even for web views that never enter
in accelerated compositing mode.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewRenderAcceleratedCompositingResults): Resize the
RedirectedXCompositeWindow to the current web view size to ensure
the sizes match before drawing.
(resizeWebKitWebViewBaseFromAllocation): Only resize the
RedirectedXCompositeWindow when in accelerated compositing mode.
* UIProcess/gtk/RedirectedXCompositeWindow.cpp:
(WebKit::RedirectedXCompositeWindow::resize): Return early if the
given size is the current size.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp (178501 => 178502)


--- releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp	2015-01-15 10:28:05 UTC (rev 178501)
+++ releases/WebKitGTK/webkit-2.6/Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp	2015-01-15 10:33:46 UTC (rev 178502)
@@ -174,6 +174,9 @@
 
 void RedirectedXCompositeWindow::resize(const IntSize& size)
 {
+    if (size == m_size)
+        return;
+
     Display* display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
     XResizeWindow(display, m_window, size.width(), size.height());
 

Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog (178501 => 178502)


--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog	2015-01-15 10:28:05 UTC (rev 178501)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog	2015-01-15 10:33:46 UTC (rev 178502)
@@ -1,3 +1,26 @@
+2015-01-14  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Do not resize the redirected XComposite window when not in accelerated compositing mode
+        https://bugs.webkit.org/show_bug.cgi?id=140353
+
+        Reviewed by Martin Robinson.
+
+        We create the redirected XComposite window unconditionally, but
+        with a size of 1x1 to save memory. However, we are always resizing
+        it, so in the end we always end up with a XWindow allocated for
+        the same size of the web view, even for web views that never enter
+        in accelerated compositing mode.
+
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewRenderAcceleratedCompositingResults): Resize the
+        RedirectedXCompositeWindow to the current web view size to ensure
+        the sizes match before drawing.
+        (resizeWebKitWebViewBaseFromAllocation): Only resize the
+        RedirectedXCompositeWindow when in accelerated compositing mode.
+        * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
+        (WebKit::RedirectedXCompositeWindow::resize): Return early if the
+        given size is the current size.
+
 2014-12-11  Alexey Proskuryakov  <[email protected]>
 
         REGRESSION (Async Text Input): Text input method state is not reset when reloading a page

Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (178501 => 178502)


--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp	2015-01-15 10:28:05 UTC (rev 178501)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp	2015-01-15 10:33:46 UTC (rev 178502)
@@ -436,6 +436,8 @@
 #if USE(TEXTURE_MAPPER_GL)
 static bool webkitWebViewRenderAcceleratedCompositingResults(WebKitWebViewBase* webViewBase, DrawingAreaProxyImpl* drawingArea, cairo_t* cr, GdkRectangle* clipRect)
 {
+    ASSERT(drawingArea);
+
     if (!drawingArea->isInAcceleratedCompositingMode())
         return false;
 
@@ -446,10 +448,14 @@
     if (!priv->redirectedWindow)
         return false;
 
-    cairo_rectangle(cr, clipRect->x, clipRect->y, clipRect->width, clipRect->height);
-    cairo_surface_t* surface = priv->redirectedWindow->cairoSurfaceForWidget(GTK_WIDGET(webViewBase));
-    cairo_set_source_surface(cr, surface, 0, 0);
-    cairo_fill(cr);
+    priv->redirectedWindow->resize(drawingArea->size());
+
+    if (cairo_surface_t* surface = priv->redirectedWindow->cairoSurfaceForWidget(GTK_WIDGET(webViewBase))) {
+        cairo_rectangle(cr, clipRect->x, clipRect->y, clipRect->width, clipRect->height);
+        cairo_set_source_surface(cr, surface, 0, 0);
+        cairo_fill(cr);
+    }
+
     return true;
 #else
     return false;
@@ -545,13 +551,15 @@
         gtk_widget_size_allocate(priv->authenticationDialog, &childAllocation);
     }
 
+    DrawingAreaProxyImpl* drawingArea = static_cast<DrawingAreaProxyImpl*>(priv->pageProxy->drawingArea());
+
 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(X11)
-    if (sizeChanged && webViewBase->priv->redirectedWindow)
-        webViewBase->priv->redirectedWindow->resize(viewRect.size());
+    if (sizeChanged && priv->redirectedWindow && drawingArea && drawingArea->isInAcceleratedCompositingMode())
+        priv->redirectedWindow->resize(viewRect.size());
 #endif
 
-    if (priv->pageProxy->drawingArea())
-        priv->pageProxy->drawingArea()->setSize(viewRect.size(), IntSize(), IntSize());
+    if (drawingArea)
+        drawingArea->setSize(viewRect.size(), IntSize(), IntSize());
 
 #if !GTK_CHECK_VERSION(3, 13, 4)
     webkitWebViewBaseNotifyResizerSize(webViewBase);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to