Title: [213060] trunk/Source/WebKit2
Revision
213060
Author
[email protected]
Date
2017-02-27 06:38:47 -0800 (Mon, 27 Feb 2017)

Log Message

[GTK] Flickering when leaving accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=168911

Reviewed by Žan Doberšek.

It doesn't always happen, and it's too fast, more noticeable in websites with a dark background, because we are
drawing a single white frame. This happens when we leave AC mode during the layer flush that schedules an update
on the compositor, which at that point only clears the area and renders nothing. However,
CoordinatedGraphicsScene::paintToCurrentGLContext() always renders a white background when no web view color has
been set. And that's the white frame we get. We could prevent that last update from happening by checking if we
still have a graphics root layer after syncDisplayState() in the layer flush, the same way we check the layer
tree host is still valid.

* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (213059 => 213060)


--- trunk/Source/WebKit2/ChangeLog	2017-02-27 14:34:48 UTC (rev 213059)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-27 14:38:47 UTC (rev 213060)
@@ -1,3 +1,22 @@
+2017-02-27  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Flickering when leaving accelerated compositing mode
+        https://bugs.webkit.org/show_bug.cgi?id=168911
+
+        Reviewed by Žan Doberšek.
+
+        It doesn't always happen, and it's too fast, more noticeable in websites with a dark background, because we are
+        drawing a single white frame. This happens when we leave AC mode during the layer flush that schedules an update
+        on the compositor, which at that point only clears the area and renders nothing. However,
+        CoordinatedGraphicsScene::paintToCurrentGLContext() always renders a white background when no web view color has
+        been set. And that's the white frame we get. We could prevent that last update from happening by checking if we
+        still have a graphics root layer after syncDisplayState() in the layer flush, the same way we check the layer
+        tree host is still valid.
+
+        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
+
 2017-02-27  Alex Christensen  <[email protected]>
 
         [libwebrtc] Enable WebRTC in some Production Builds

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h (213059 => 213060)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h	2017-02-27 14:34:48 UTC (rev 213059)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h	2017-02-27 14:38:47 UTC (rev 213060)
@@ -79,6 +79,7 @@
 
     void createRootLayer(const WebCore::IntSize&);
     WebCore::GraphicsLayer* rootLayer() const { return m_rootLayer.get(); }
+    WebCore::GraphicsLayer* rootCompositingLayer() const { return m_rootCompositingLayer; }
     WebCore::CoordinatedGraphicsLayer* mainContentsLayer();
 
     bool flushPendingLayerChanges();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp (213059 => 213060)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2017-02-27 14:34:48 UTC (rev 213059)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2017-02-27 14:38:47 UTC (rev 213060)
@@ -167,7 +167,7 @@
 
     m_coordinator.syncDisplayState();
 
-    if (!m_isValid)
+    if (!m_isValid || !m_coordinator.rootCompositingLayer())
         return;
 
     bool didSync = m_coordinator.flushPendingLayerChanges();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to