Title: [137109] trunk/Source/WebKit2
- Revision
- 137109
- Author
- [email protected]
- Date
- 2012-12-09 22:45:58 -0800 (Sun, 09 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-09
Reviewed by Noam Rosenthal.
Send SetRootCompositingLayer message to the UI process before
flushing compositing states of layer tree.
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::flushPendingLayerChanges):
(WebKit::LayerTreeCoordinator::initializeRootCompositingLayerIfNeeded):
(WebKit):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
(LayerTreeCoordinator):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (137108 => 137109)
--- trunk/Source/WebKit2/ChangeLog 2012-12-10 06:16:45 UTC (rev 137108)
+++ trunk/Source/WebKit2/ChangeLog 2012-12-10 06:45:58 UTC (rev 137109)
@@ -1,3 +1,27 @@
+2012-12-09 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 before
+ flushing compositing states of layer tree.
+
+ 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::flushPendingLayerChanges):
+ (WebKit::LayerTreeCoordinator::initializeRootCompositingLayerIfNeeded):
+ (WebKit):
+ * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
+ (LayerTreeCoordinator):
+
2012-12-09 Jon Lee <[email protected]>
[WK2] Move button image to injected bundle
Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp (137108 => 137109)
--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp 2012-12-10 06:16:45 UTC (rev 137108)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp 2012-12-10 06:45:58 UTC (rev 137109)
@@ -328,6 +328,7 @@
void LayerTreeRenderer::setLayerState(CoordinatedLayerID id, const CoordinatedLayerInfo& layerInfo)
{
+ ASSERT(m_rootLayerID != InvalidCoordinatedLayerID);
GraphicsLayer* layer = ensureLayer(id);
layer->setReplicatedByLayer(layerByID(layerInfo.replica));
@@ -359,8 +360,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(CoordinatedLayerID layerID)
@@ -403,10 +402,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 (137108 => 137109)
--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp 2012-12-10 06:16:45 UTC (rev 137108)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp 2012-12-10 06:45:58 UTC (rev 137109)
@@ -90,7 +90,7 @@
, m_contentsScale(1)
, m_shouldSendScrollPositionUpdate(true)
, m_shouldSyncFrame(false)
- , m_shouldSyncRootLayer(true)
+ , m_didInitializeRootCompositingLayer(false)
, m_layerFlushTimer(this, &LayerTreeCoordinator::layerFlushTimerFired)
, m_releaseInactiveAtlasesTimer(this, &LayerTreeCoordinator::releaseInactiveAtlasesTimerFired)
, m_layerFlushSchedulingEnabled(true)
@@ -268,6 +268,8 @@
if (m_waitingForUIProcess)
return false;
+ initializeRootCompositingLayerIfNeeded();
+
m_rootLayer->flushCompositingStateForThisLayerOnly();
m_nonCompositedContentLayer->flushCompositingStateForThisLayerOnly();
if (m_pageOverlayLayer)
@@ -277,12 +279,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();
@@ -306,6 +302,16 @@
return didSync;
}
+void LayerTreeCoordinator::initializeRootCompositingLayerIfNeeded()
+{
+ if (m_didInitializeRootCompositingLayer)
+ return;
+
+ m_webPage->send(Messages::LayerTreeCoordinatorProxy::SetRootCompositingLayer(toCoordinatedGraphicsLayer(m_rootLayer.get())->id()));
+ m_didInitializeRootCompositingLayer = true;
+ m_shouldSyncFrame = true;
+}
+
void LayerTreeCoordinator::syncLayerState(CoordinatedLayerID id, const CoordinatedLayerInfo& info)
{
if (m_shouldSendScrollPositionUpdate) {
Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h (137108 => 137109)
--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h 2012-12-10 06:16:45 UTC (rev 137108)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h 2012-12-10 06:45:58 UTC (rev 137109)
@@ -135,6 +135,7 @@
virtual PassOwnPtr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE;
// LayerTreeCoordinator
+ void initializeRootCompositingLayerIfNeeded();
void createPageOverlayLayer();
void destroyPageOverlayLayer();
bool flushPendingLayerChanges();
@@ -193,7 +194,7 @@
LayerTreeContext m_layerTreeContext;
bool m_shouldSyncFrame;
- bool m_shouldSyncRootLayer;
+ bool m_didInitializeRootCompositingLayer;
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