Title: [200408] trunk/Source
Revision
200408
Author
[email protected]
Date
2016-05-04 00:39:23 -0700 (Wed, 04 May 2016)

Log Message

[CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
https://bugs.webkit.org/show_bug.cgi?id=157305

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Split out handling of the root compositing and the view overlay layers
into two separate methods. Both do nothing if the passed-in layer is
the same as the current one. Otherwise, the current one is removed
from the tree and the new one added to it.

No change in behavior is expected.

* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::setRootCompositingLayer):
(WebCore::CompositingCoordinator::setViewOverlayRootLayer):
* platform/graphics/texmap/coordinated/CompositingCoordinator.h:

Source/WebKit2:

Update CoordinatedLayerTreeHost and ThreadCoordinatedLayerTreeHost to
correctly use setRootCompositingLayer() and setViewOverlayRootLayer()
methods on the CompositingCoordinator object.

CoordinatedLayerTreeHost doesn't have to keep a pointer to the root
compositing layer anymore. updateRootLayers() can be removed.

ThreadCoordinatedLayerTreeHost doen't have to keep a pointer to both
the root compositing and the view overlay layers anymore. Similarly,
updateRootLayers() can be removed.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
(WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): Deleted.
(WebKit::CoordinatedLayerTreeHost::updateRootLayers): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::setRootCompositingLayer):
(WebKit::ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer):
(WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Deleted.
(WebKit::ThreadedCoordinatedLayerTreeHost::updateRootLayers): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (200407 => 200408)


--- trunk/Source/WebCore/ChangeLog	2016-05-04 07:36:17 UTC (rev 200407)
+++ trunk/Source/WebCore/ChangeLog	2016-05-04 07:39:23 UTC (rev 200408)
@@ -1,5 +1,24 @@
 2016-05-04  Zan Dobersek  <[email protected]>
 
+        [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
+        https://bugs.webkit.org/show_bug.cgi?id=157305
+
+        Reviewed by Carlos Garcia Campos.
+
+        Split out handling of the root compositing and the view overlay layers
+        into two separate methods. Both do nothing if the passed-in layer is
+        the same as the current one. Otherwise, the current one is removed
+        from the tree and the new one added to it.
+
+        No change in behavior is expected.
+
+        * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
+        (WebCore::CompositingCoordinator::setRootCompositingLayer):
+        (WebCore::CompositingCoordinator::setViewOverlayRootLayer):
+        * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
+
+2016-05-04  Zan Dobersek  <[email protected]>
+
         [TexMap] Clean up TextureMapperGLData, TextureMapperGLData::SharedGLData
         https://bugs.webkit.org/show_bug.cgi?id=157303
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp (200407 => 200408)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp	2016-05-04 07:36:17 UTC (rev 200407)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp	2016-05-04 07:39:23 UTC (rev 200408)
@@ -70,17 +70,29 @@
         registeredLayer->setCoordinator(nullptr);
 }
 
-void CompositingCoordinator::setRootCompositingLayer(GraphicsLayer* compositingLayer, GraphicsLayer* overlayLayer)
+void CompositingCoordinator::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
 {
+    if (m_rootCompositingLayer == graphicsLayer)
+        return;
+
     if (m_rootCompositingLayer)
         m_rootCompositingLayer->removeFromParent();
 
-    m_rootCompositingLayer = compositingLayer;
+    m_rootCompositingLayer = graphicsLayer;
     if (m_rootCompositingLayer)
         m_rootLayer->addChildAtIndex(m_rootCompositingLayer, 0);
+}
 
-    m_overlayCompositingLayer = overlayLayer;
+void CompositingCoordinator::setViewOverlayRootLayer(GraphicsLayer* graphicsLayer)
+{
+    if (m_overlayCompositingLayer == graphicsLayer)
+        return;
+
     if (m_overlayCompositingLayer)
+        m_overlayCompositingLayer->removeFromParent();
+
+    m_overlayCompositingLayer = graphicsLayer;
+    if (m_overlayCompositingLayer)
         m_rootLayer->addChild(m_overlayCompositingLayer);
 }
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h (200407 => 200408)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h	2016-05-04 07:36:17 UTC (rev 200407)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h	2016-05-04 07:39:23 UTC (rev 200408)
@@ -64,7 +64,8 @@
     CompositingCoordinator(Page*, CompositingCoordinator::Client*);
     virtual ~CompositingCoordinator();
 
-    void setRootCompositingLayer(GraphicsLayer* compositingLayer, GraphicsLayer* overlayLayer);
+    void setRootCompositingLayer(GraphicsLayer*);
+    void setViewOverlayRootLayer(GraphicsLayer*);
     void sizeDidChange(const IntSize& newSize);
     void deviceOrPageScaleFactorChanged();
 

Modified: trunk/Source/WebKit2/ChangeLog (200407 => 200408)


--- trunk/Source/WebKit2/ChangeLog	2016-05-04 07:36:17 UTC (rev 200407)
+++ trunk/Source/WebKit2/ChangeLog	2016-05-04 07:39:23 UTC (rev 200408)
@@ -1,3 +1,34 @@
+2016-05-04  Zan Dobersek  <[email protected]>
+
+        [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
+        https://bugs.webkit.org/show_bug.cgi?id=157305
+
+        Reviewed by Carlos Garcia Campos.
+
+        Update CoordinatedLayerTreeHost and ThreadCoordinatedLayerTreeHost to
+        correctly use setRootCompositingLayer() and setViewOverlayRootLayer()
+        methods on the CompositingCoordinator object.
+
+        CoordinatedLayerTreeHost doesn't have to keep a pointer to the root
+        compositing layer anymore. updateRootLayers() can be removed.
+
+        ThreadCoordinatedLayerTreeHost doen't have to keep a pointer to both
+        the root compositing and the view overlay layers anymore. Similarly,
+        updateRootLayers() can be removed.
+
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
+        (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
+        (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): Deleted.
+        (WebKit::CoordinatedLayerTreeHost::updateRootLayers): Deleted.
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
+        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
+        (WebKit::ThreadedCoordinatedLayerTreeHost::setRootCompositingLayer):
+        (WebKit::ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer):
+        (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Deleted.
+        (WebKit::ThreadedCoordinatedLayerTreeHost::updateRootLayers): Deleted.
+        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
+
 2016-05-03  Beth Dakin  <[email protected]>
 
         Add VideoControlsManager tests

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


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2016-05-04 07:36:17 UTC (rev 200407)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2016-05-04 07:39:23 UTC (rev 200408)
@@ -67,7 +67,6 @@
     , m_layerFlushTimer(*this, &CoordinatedLayerTreeHost::layerFlushTimerFired)
     , m_layerFlushSchedulingEnabled(true)
     , m_forceRepaintAsyncCallbackID(0)
-    , m_contentLayer(nullptr)
     , m_viewOverlayRootLayer(nullptr)
 {
     m_coordinator = std::make_unique<CompositingCoordinator>(webPage->corePage(), this);
@@ -114,24 +113,15 @@
     m_notifyAfterScheduledLayerFlush = notifyAfterScheduledLayerFlush;
 }
 
-void CoordinatedLayerTreeHost::updateRootLayers()
-{
-    if (!m_contentLayer && !m_viewOverlayRootLayer)
-        return;
-
-    m_coordinator->setRootCompositingLayer(m_contentLayer, m_viewOverlayRootLayer);
-}
-
 void CoordinatedLayerTreeHost::setViewOverlayRootLayer(WebCore::GraphicsLayer* viewOverlayRootLayer)
 {
     m_viewOverlayRootLayer = viewOverlayRootLayer;
-    updateRootLayers();
+    m_coordinator->setViewOverlayRootLayer(viewOverlayRootLayer);
 }
 
 void CoordinatedLayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer)
 {
-    m_contentLayer = graphicsLayer;
-    updateRootLayers();
+    m_coordinator->setRootCompositingLayer(graphicsLayer);
 }
 
 void CoordinatedLayerTreeHost::invalidate()

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h (200407 => 200408)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h	2016-05-04 07:36:17 UTC (rev 200407)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h	2016-05-04 07:39:23 UTC (rev 200408)
@@ -88,8 +88,6 @@
 
     void layerFlushTimerFired();
 
-    void updateRootLayers();
-
     // CompositingCoordinator::Client
     void didFlushRootLayer(const WebCore::FloatRect& visibleContentRect) override;
     void notifyFlushRequired() override { scheduleLayerFlush(); };
@@ -109,7 +107,6 @@
     bool m_layerFlushSchedulingEnabled;
     uint64_t m_forceRepaintAsyncCallbackID;
 
-    WebCore::GraphicsLayer* m_contentLayer;
     WebCore::GraphicsLayer* m_viewOverlayRootLayer;
 };
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp (200407 => 200408)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp	2016-05-04 07:36:17 UTC (rev 200407)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp	2016-05-04 07:39:23 UTC (rev 200408)
@@ -60,8 +60,6 @@
 ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost(WebPage* webPage)
     : LayerTreeHost(webPage)
     , m_forceRepaintAsyncCallbackID(0)
-    , m_contentLayer(nullptr)
-    , m_viewOverlayRootLayer(nullptr)
     , m_notifyAfterScheduledLayerFlush(false)
     , m_isSuspended(false)
     , m_isWaitingForRenderer(false)
@@ -114,8 +112,7 @@
 
 void ThreadedCoordinatedLayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer)
 {
-    m_contentLayer = graphicsLayer;
-    updateRootLayers();
+    m_coordinator->setRootCompositingLayer(graphicsLayer);
 }
 
 void ThreadedCoordinatedLayerTreeHost::invalidate()
@@ -191,20 +188,11 @@
     m_webPage->scalePage(scale, origin);
 }
 
-void ThreadedCoordinatedLayerTreeHost::updateRootLayers()
+void ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer(GraphicsLayer* graphicsLayer)
 {
-    if (!m_contentLayer && !m_viewOverlayRootLayer)
-        return;
-
-    m_coordinator->setRootCompositingLayer(m_contentLayer, m_viewOverlayRootLayer);
+    m_coordinator->setViewOverlayRootLayer(graphicsLayer);
 }
 
-void ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer(GraphicsLayer* viewOverlayRootLayer)
-{
-    m_viewOverlayRootLayer = viewOverlayRootLayer;
-    updateRootLayers();
-}
-
 #if PLATFORM(GTK)
 void ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing(uint64_t handle)
 {

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h (200407 => 200408)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h	2016-05-04 07:36:17 UTC (rev 200407)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h	2016-05-04 07:39:23 UTC (rev 200408)
@@ -108,8 +108,6 @@
     void compositorDidFlushLayers();
     void didScaleFactorChanged(float scale, const WebCore::IntPoint& origin);
 
-    void updateRootLayers();
-
     void cancelPendingLayerFlush();
     void performScheduledLayerFlush();
 
@@ -132,9 +130,6 @@
 
     WebCore::IntPoint m_prevScrollPosition;
 
-    WebCore::GraphicsLayer* m_contentLayer;
-    WebCore::GraphicsLayer* m_viewOverlayRootLayer;
-
     std::unique_ptr<WebCore::CompositingCoordinator> m_coordinator;
     RefPtr<ThreadedCompositor> m_compositor;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to