Title: [135443] trunk/Source/WebKit2
Revision
135443
Author
[email protected]
Date
2012-11-21 15:21:41 -0800 (Wed, 21 Nov 2012)

Log Message

Coordinated Graphics: refactor changing children code in CoordinatedGraphicsLayer.
https://bugs.webkit.org/show_bug.cgi?id=102896

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

When changing children, we don't need to sync a layer state because
there is no more need to send the parent ID every time the layer tree
hierarchy changes. So this patch removes didChangeLayerState() in
methods which change children.

In addition, purgeBackingStores() does not need to call didChangeChildren()
because purgeBackingStores() does not change children.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setChildren):
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::removeFromParent):
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (135442 => 135443)


--- trunk/Source/WebKit2/ChangeLog	2012-11-21 23:09:25 UTC (rev 135442)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-21 23:21:41 UTC (rev 135443)
@@ -1,5 +1,30 @@
 2012-11-21  Huang Dongsung  <[email protected]>
 
+        Coordinated Graphics: refactor changing children code in CoordinatedGraphicsLayer.
+        https://bugs.webkit.org/show_bug.cgi?id=102896
+
+        Reviewed by Noam Rosenthal.
+
+        When changing children, we don't need to sync a layer state because
+        there is no more need to send the parent ID every time the layer tree
+        hierarchy changes. So this patch removes didChangeLayerState() in
+        methods which change children.
+
+        In addition, purgeBackingStores() does not need to call didChangeChildren()
+        because purgeBackingStores() does not change children.
+
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::setChildren):
+        (WebCore::CoordinatedGraphicsLayer::addChild):
+        (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
+        (WebCore::CoordinatedGraphicsLayer::addChildAbove):
+        (WebCore::CoordinatedGraphicsLayer::addChildBelow):
+        (WebCore::CoordinatedGraphicsLayer::replaceChild):
+        (WebCore::CoordinatedGraphicsLayer::removeFromParent):
+        (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
+
+2012-11-21  Huang Dongsung  <[email protected]>
+
         REGRESSION(r135212): Fix crash due to an infinite rect.
         https://bugs.webkit.org/show_bug.cgi?id=102891
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp (135442 => 135443)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp	2012-11-21 23:09:25 UTC (rev 135442)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp	2012-11-21 23:21:41 UTC (rev 135443)
@@ -146,10 +146,6 @@
     bool ok = GraphicsLayer::setChildren(children);
     if (!ok)
         return false;
-    for (unsigned i = 0; i < children.size(); ++i) {
-        CoordinatedGraphicsLayer* child = toCoordinatedGraphicsLayer(children[i]);
-        child->didChangeLayerState();
-    }
     didChangeChildren();
     return true;
 }
@@ -157,28 +153,24 @@
 void CoordinatedGraphicsLayer::addChild(GraphicsLayer* layer)
 {
     GraphicsLayer::addChild(layer);
-    toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
     didChangeChildren();
 }
 
 void CoordinatedGraphicsLayer::addChildAtIndex(GraphicsLayer* layer, int index)
 {
     GraphicsLayer::addChildAtIndex(layer, index);
-    toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
     didChangeChildren();
 }
 
 void CoordinatedGraphicsLayer::addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling)
 {
     GraphicsLayer::addChildAbove(layer, sibling);
-    toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
     didChangeChildren();
 }
 
 void CoordinatedGraphicsLayer::addChildBelow(GraphicsLayer* layer, GraphicsLayer* sibling)
 {
     GraphicsLayer::addChildBelow(layer, sibling);
-    toCoordinatedGraphicsLayer(layer)->didChangeLayerState();
     didChangeChildren();
 }
 
@@ -188,8 +180,6 @@
     if (!ok)
         return false;
     didChangeChildren();
-    toCoordinatedGraphicsLayer(oldChild)->didChangeLayerState();
-    toCoordinatedGraphicsLayer(newChild)->didChangeLayerState();
     return true;
 }
 
@@ -198,8 +188,6 @@
     if (CoordinatedGraphicsLayer* parentLayer = toCoordinatedGraphicsLayer(parent()))
         parentLayer->didChangeChildren();
     GraphicsLayer::removeFromParent();
-
-    didChangeLayerState();
 }
 
 void CoordinatedGraphicsLayer::setPosition(const FloatPoint& p)
@@ -789,7 +777,6 @@
     releaseImageBackingIfNeeded();
 
     didChangeLayerState();
-    didChangeChildren();
 }
 
 void CoordinatedGraphicsLayer::setCoordinator(WebKit::CoordinatedGraphicsLayerClient* coordinator)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to