Title: [136788] trunk/Source/WebKit2
Revision
136788
Author
[email protected]
Date
2012-12-05 18:50:02 -0800 (Wed, 05 Dec 2012)

Log Message

Coordinated Graphics: Reorder messages to LayerTreeCoordinatorProxy
https://bugs.webkit.org/show_bug.cgi?id=103843

Patch by Huang Dongsung <[email protected]> on 2012-12-05
Reviewed by Noam Rosenthal.

Send SetRootCompositingLayer message to the UI process in the
constructor instead of sending it on the first flush.

This is in preparation for refactoring TextureMapper to work in an actor
model (http://webkit.org/b/103854).

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::setLayerState):
(WebKit::LayerTreeRenderer::setRootLayerID):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::LayerTreeCoordinator):
(WebKit::LayerTreeCoordinator::initializeRootCompositingLayer):
(WebKit):
(WebKit::LayerTreeCoordinator::flushPendingLayerChanges):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
(LayerTreeCoordinator):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (136787 => 136788)


--- trunk/Source/WebKit2/ChangeLog	2012-12-06 02:38:22 UTC (rev 136787)
+++ trunk/Source/WebKit2/ChangeLog	2012-12-06 02:50:02 UTC (rev 136788)
@@ -1,3 +1,27 @@
+2012-12-05  Huang Dongsung  <[email protected]>
+
+        Coordinated Graphics: Reorder messages to LayerTreeCoordinatorProxy
+        https://bugs.webkit.org/show_bug.cgi?id=103843
+
+        Reviewed by Noam Rosenthal.
+
+        Send SetRootCompositingLayer message to the UI process in the
+        constructor instead of sending it on the first flush.
+
+        This is in preparation for refactoring TextureMapper to work in an actor
+        model (http://webkit.org/b/103854).
+
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
+        (WebKit::LayerTreeRenderer::setLayerState):
+        (WebKit::LayerTreeRenderer::setRootLayerID):
+        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
+        (WebKit::LayerTreeCoordinator::LayerTreeCoordinator):
+        (WebKit::LayerTreeCoordinator::initializeRootCompositingLayer):
+        (WebKit):
+        (WebKit::LayerTreeCoordinator::flushPendingLayerChanges):
+        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
+        (LayerTreeCoordinator):
+
 2012-12-05  Jinwoo Song  <[email protected]>
 
         [EFL][WK2] Don't use the C API internally in ewk_cookie_manager

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp (136787 => 136788)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2012-12-06 02:38:22 UTC (rev 136787)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2012-12-06 02:50:02 UTC (rev 136788)
@@ -328,6 +328,7 @@
 
 void LayerTreeRenderer::setLayerState(WebLayerID id, const WebLayerInfo& layerInfo)
 {
+    ASSERT(m_rootLayerID != InvalidWebLayerID);
     GraphicsLayer* layer = ensureLayer(id);
 
     layer->setReplicatedByLayer(layerByID(layerInfo.replica));
@@ -358,8 +359,6 @@
     layer->setMasksToBounds(layerInfo.isRootLayer ? false : layerInfo.masksToBounds);
     layer->setOpacity(layerInfo.opacity);
     layer->setPreserves3D(layerInfo.preserves3D);
-    if (layerInfo.isRootLayer && m_rootLayerID != id)
-        setRootLayerID(id);
 }
 
 void LayerTreeRenderer::deleteLayer(WebLayerID layerID)
@@ -402,10 +401,7 @@
     if (!layerID)
         return;
 
-    GraphicsLayer* layer = layerByID(layerID);
-    if (!layer)
-        return;
-
+    GraphicsLayer* layer = ensureLayer(layerID);
     m_rootLayer->addChild(layer);
 }
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp (136787 => 136788)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp	2012-12-06 02:38:22 UTC (rev 136787)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp	2012-12-06 02:50:02 UTC (rev 136788)
@@ -90,7 +90,6 @@
     , m_contentsScale(1)
     , m_shouldSendScrollPositionUpdate(true)
     , m_shouldSyncFrame(false)
-    , m_shouldSyncRootLayer(true)
     , m_layerFlushTimer(this, &LayerTreeCoordinator::layerFlushTimerFired)
     , m_releaseInactiveAtlasesTimer(this, &LayerTreeCoordinator::releaseInactiveAtlasesTimerFired)
     , m_layerFlushSchedulingEnabled(true)
@@ -120,9 +119,16 @@
     if (m_webPage->hasPageOverlay())
         createPageOverlayLayer();
 
+    initializeRootCompositingLayer();
     scheduleLayerFlush();
 }
 
+void LayerTreeCoordinator::initializeRootCompositingLayer()
+{
+    m_webPage->send(Messages::LayerTreeCoordinatorProxy::SetRootCompositingLayer(toCoordinatedGraphicsLayer(m_rootLayer.get())->id()));
+    m_shouldSyncFrame = true;
+}
+
 void LayerTreeCoordinator::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
 {
     if (m_layerFlushSchedulingEnabled == layerFlushingEnabled)
@@ -277,12 +283,6 @@
 
     flushPendingImageBackingChanges();
 
-    if (m_shouldSyncRootLayer) {
-        m_webPage->send(Messages::LayerTreeCoordinatorProxy::SetRootCompositingLayer(toCoordinatedGraphicsLayer(m_rootLayer.get())->id()));
-        m_shouldSyncRootLayer = false;
-        m_shouldSyncFrame = true;
-    }
-
     for (size_t i = 0; i < m_detachedLayers.size(); ++i)
         m_webPage->send(Messages::LayerTreeCoordinatorProxy::DeleteCompositingLayer(m_detachedLayers[i]));
     m_detachedLayers.clear();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h (136787 => 136788)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h	2012-12-06 02:38:22 UTC (rev 136787)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h	2012-12-06 02:50:02 UTC (rev 136788)
@@ -135,6 +135,7 @@
     virtual PassOwnPtr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE;
 
     // LayerTreeCoordinator
+    void initializeRootCompositingLayer();
     void createPageOverlayLayer();
     void destroyPageOverlayLayer();
     bool flushPendingLayerChanges();
@@ -193,7 +194,6 @@
 
     LayerTreeContext m_layerTreeContext;
     bool m_shouldSyncFrame;
-    bool m_shouldSyncRootLayer;
     WebCore::Timer<LayerTreeCoordinator> m_layerFlushTimer;
     WebCore::Timer<LayerTreeCoordinator> m_releaseInactiveAtlasesTimer;
     bool m_layerFlushSchedulingEnabled;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to