Title: [140053] trunk/Source/WebKit2
Revision
140053
Author
commit-qu...@webkit.org
Date
2013-01-17 14:55:06 -0800 (Thu, 17 Jan 2013)

Log Message

Coordinated Graphics: Remove redundant behaviors in LayerTreeRenderer.
https://bugs.webkit.org/show_bug.cgi?id=107084

Patch by Huang Dongsung <luxte...@company100.net> on 2013-01-17
Reviewed by Noam Rosenthal.

There are two changes.
1. It is redundant to call GraphicsLayer::removeFromParent() or
GraphicsLayer::removeAllChildren() before deleting GraphicsLayer, because the
destructor of GraphicsLayerTextureMapper removes a parent and all children.
2. LayerTreeRenderer::setRootLayerID() does not need to remove all children of
rootLayer because this method can be called only once.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::deleteLayer):
(WebKit::LayerTreeRenderer::setRootLayerID):
(WebKit::LayerTreeRenderer::purgeGLResources):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (140052 => 140053)


--- trunk/Source/WebKit2/ChangeLog	2013-01-17 22:54:57 UTC (rev 140052)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-17 22:55:06 UTC (rev 140053)
@@ -1,3 +1,22 @@
+2013-01-17  Huang Dongsung  <luxte...@company100.net>
+
+        Coordinated Graphics: Remove redundant behaviors in LayerTreeRenderer.
+        https://bugs.webkit.org/show_bug.cgi?id=107084
+
+        Reviewed by Noam Rosenthal.
+
+        There are two changes.
+        1. It is redundant to call GraphicsLayer::removeFromParent() or
+        GraphicsLayer::removeAllChildren() before deleting GraphicsLayer, because the
+        destructor of GraphicsLayerTextureMapper removes a parent and all children.
+        2. LayerTreeRenderer::setRootLayerID() does not need to remove all children of
+        rootLayer because this method can be called only once.
+
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
+        (WebKit::LayerTreeRenderer::deleteLayer):
+        (WebKit::LayerTreeRenderer::setRootLayerID):
+        (WebKit::LayerTreeRenderer::purgeGLResources):
+
 2013-01-17  Timothy Hatcher  <timo...@apple.com>
 
         Make logging console messages to STDOUT work in WebKit2 via a new setting.

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp (140052 => 140053)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-17 22:54:57 UTC (rev 140052)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-17 22:55:06 UTC (rev 140053)
@@ -365,7 +365,6 @@
     OwnPtr<GraphicsLayer> layer = m_layers.take(layerID);
     ASSERT(layer);
 
-    layer->removeFromParent();
     m_pendingSyncBackingStores.remove(toTextureMapperLayer(layer.get()));
     m_fixedLayers.remove(layerID);
 #if USE(GRAPHICS_SURFACE)
@@ -379,9 +378,9 @@
     ASSERT(m_rootLayerID == InvalidCoordinatedLayerID);
 
     m_rootLayerID = layerID;
-    m_rootLayer->removeAllChildren();
 
     GraphicsLayer* layer = layerByID(layerID);
+    ASSERT(m_rootLayer->children().isEmpty());
     m_rootLayer->addChild(layer);
 }
 
@@ -635,7 +634,6 @@
     m_surfaceBackingStores.clear();
 #endif
 
-    m_rootLayer->removeAllChildren();
     m_rootLayer.clear();
     m_rootLayerID = InvalidCoordinatedLayerID;
     m_layers.clear();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to