Title: [193901] trunk/Source/WebKit2
Revision
193901
Author
[email protected]
Date
2015-12-10 04:12:17 -0800 (Thu, 10 Dec 2015)

Log Message

[CoordinatedGraphics] Reserve capacity for the children vector in CoordinatedGraphicsScene::setLayerChildrenIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=152117

Reviewed by Martin Robinson.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::setLayerChildrenIfNeeded): Reserve the capacity
for the new Vector that will contain the same number of items as the Vector
on the CoordinatedGraphicsLayerState object.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (193900 => 193901)


--- trunk/Source/WebKit2/ChangeLog	2015-12-10 12:01:42 UTC (rev 193900)
+++ trunk/Source/WebKit2/ChangeLog	2015-12-10 12:12:17 UTC (rev 193901)
@@ -1,3 +1,15 @@
+2015-12-10  Zan Dobersek  <[email protected]>
+
+        [CoordinatedGraphics] Reserve capacity for the children vector in CoordinatedGraphicsScene::setLayerChildrenIfNeeded()
+        https://bugs.webkit.org/show_bug.cgi?id=152117
+
+        Reviewed by Martin Robinson.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+        (WebKit::CoordinatedGraphicsScene::setLayerChildrenIfNeeded): Reserve the capacity
+        for the new Vector that will contain the same number of items as the Vector
+        on the CoordinatedGraphicsLayerState object.
+
 2015-12-09  Daniel Bates  <[email protected]>
 
         [iOS] Bail out if the page proxy is invalid when WebPageProxy::processWillBecome{Foreground, Suspended}() are called

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (193900 => 193901)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2015-12-10 12:01:42 UTC (rev 193900)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2015-12-10 12:12:17 UTC (rev 193901)
@@ -246,11 +246,10 @@
         return;
 
     Vector<TextureMapperLayer*> children;
+    children.reserveCapacity(state.children.size());
+    for (auto& child : state.children)
+        children.append(layerByID(child));
 
-    for (auto& child : state.children) {
-        TextureMapperLayer* childLayer = layerByID(child);
-        children.append(childLayer);
-    }
     layer->setChildren(children);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to