Title: [178414] trunk/Source/WebKit2
Revision
178414
Author
[email protected]
Date
2015-01-14 01:00:14 -0800 (Wed, 14 Jan 2015)

Log Message

[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: trunk/Source/WebKit2/ChangeLog (178413 => 178414)


--- trunk/Source/WebKit2/ChangeLog	2015-01-14 08:55:51 UTC (rev 178413)
+++ trunk/Source/WebKit2/ChangeLog	2015-01-14 09:00:14 UTC (rev 178414)
@@ -1,5 +1,28 @@
 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.
+
+2015-01-14  Carlos Garcia Campos  <[email protected]>
+
         REGRESSION(r177075): Flickering when the WebView is realized
         https://bugs.webkit.org/show_bug.cgi?id=140352
 

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (178413 => 178414)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp	2015-01-14 08:55:51 UTC (rev 178413)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp	2015-01-14 09:00:14 UTC (rev 178414)
@@ -506,6 +506,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;
 
@@ -516,6 +518,8 @@
     if (!priv->redirectedWindow)
         return false;
 
+    priv->redirectedWindow->resize(drawingArea->size());
+
     if (cairo_surface_t* surface = priv->redirectedWindow->surface()) {
         cairo_rectangle(cr, clipRect->x, clipRect->y, clipRect->width, clipRect->height);
         cairo_set_source_surface(cr, surface, 0, 0);
@@ -618,13 +622,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);

Modified: trunk/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp (178413 => 178414)


--- trunk/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp	2015-01-14 08:55:51 UTC (rev 178413)
+++ trunk/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp	2015-01-14 09:00:14 UTC (rev 178414)
@@ -212,6 +212,9 @@
 
 void RedirectedXCompositeWindow::resize(const IntSize& size)
 {
+    if (size == m_size)
+        return;
+
     XResizeWindow(m_display, m_window, size.width(), size.height());
     XFlush(m_display);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to