Title: [89980] trunk/Source/WebCore
- Revision
- 89980
- Author
- [email protected]
- Date
- 2011-06-28 17:57:24 -0700 (Tue, 28 Jun 2011)
Log Message
2011-06-28 Zeng Huiqing <[email protected]>
Reviewed by Kenneth Russell.
[chromium]Optimize GraphicsLayerChromium::setChildren()
https://bugs.webkit.org/show_bug.cgi?id=62837
No new tests.
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
(WebCore::GraphicsLayerChromium::setChildren):
(WebCore::GraphicsLayerChromium::addChild):
* platform/graphics/chromium/GraphicsLayerChromium.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (89979 => 89980)
--- trunk/Source/WebCore/ChangeLog 2011-06-29 00:53:04 UTC (rev 89979)
+++ trunk/Source/WebCore/ChangeLog 2011-06-29 00:57:24 UTC (rev 89980)
@@ -1,3 +1,18 @@
+2011-06-28 Zeng Huiqing <[email protected]>
+
+ Reviewed by Kenneth Russell.
+
+ [chromium]Optimize GraphicsLayerChromium::setChildren()
+ https://bugs.webkit.org/show_bug.cgi?id=62837
+
+ No new tests.
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::setChildren):
+ (WebCore::GraphicsLayerChromium::addChild):
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+
2011-06-28 Levi Weintraub <[email protected]>
Reviewed by Eric Seidel.
Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp (89979 => 89980)
--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2011-06-29 00:53:04 UTC (rev 89979)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2011-06-29 00:57:24 UTC (rev 89980)
@@ -93,6 +93,7 @@
: GraphicsLayer(client)
, m_contentsLayerPurpose(NoContentsLayer)
, m_contentsLayerHasBackgroundColor(false)
+ , m_inSetChildren(false)
{
m_layer = ContentLayerChromium::create(this);
@@ -129,11 +130,12 @@
bool GraphicsLayerChromium::setChildren(const Vector<GraphicsLayer*>& children)
{
+ m_inSetChildren = true;
bool childrenChanged = GraphicsLayer::setChildren(children);
- // FIXME: GraphicsLayer::setChildren calls addChild() for each child, which
- // will end up calling updateChildList() N times.
+
if (childrenChanged)
updateChildList();
+ m_inSetChildren = false;
return childrenChanged;
}
@@ -141,7 +143,8 @@
void GraphicsLayerChromium::addChild(GraphicsLayer* childLayer)
{
GraphicsLayer::addChild(childLayer);
- updateChildList();
+ if (!m_inSetChildren)
+ updateChildList();
}
void GraphicsLayerChromium::addChildAtIndex(GraphicsLayer* childLayer, int index)
Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h (89979 => 89980)
--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h 2011-06-29 00:53:04 UTC (rev 89979)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h 2011-06-29 00:57:24 UTC (rev 89980)
@@ -143,6 +143,7 @@
ContentsLayerPurpose m_contentsLayerPurpose;
bool m_contentsLayerHasBackgroundColor : 1;
+ bool m_inSetChildren;
};
} // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes