Title: [140634] trunk/Source/WebKit2
Revision
140634
Author
[email protected]
Date
2013-01-23 18:57:46 -0800 (Wed, 23 Jan 2013)

Log Message

Coordinated Graphics : Reduce the number of calls to Functional and number of IPC messages by sending the created/deleted layers in a vector.
https://bugs.webkit.org/show_bug.cgi?id=107625

Patch by Seulgi Kim <[email protected]> on 2013-01-23
Reviewed by Benjamin Poulain.

Currently, the number of messages sent by CoordinatedLayerTreeHost is
equal to the number of layers created/deleted even though they requested
in the same cycle.
It's not good since CoreIPC creates functional before sending messages,
and CoordinatedLayerTreeHostProxy creates functional before
create/delete layers.

This patch makes CoordinatedLayerTreeHost send just one
CreateCompositingLayers message and CoordinatedLayerTreeHostProxy create
just one functional in a cycle. The same work has been done with
DeleteCompositingLayers message.

This patch will reduce the number of calls to Functional and number of
IPC messages by sending the created/deleted layers in a vector.

No new tests, no change in behavior.

* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
(WebKit::CoordinatedLayerTreeHostProxy::createCompositingLayers):
(WebKit::CoordinatedLayerTreeHostProxy::deleteCompositingLayers):
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
(CoordinatedLayerTreeHostProxy):
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::createLayers):
(WebKit):
(WebKit::LayerTreeRenderer::deleteLayers):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(LayerTreeRenderer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::createCompositingLayers):
(WebKit::CoordinatedLayerTreeHost::deleteCompositingLayers):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (140633 => 140634)


--- trunk/Source/WebKit2/ChangeLog	2013-01-24 02:55:32 UTC (rev 140633)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-24 02:57:46 UTC (rev 140634)
@@ -1,3 +1,43 @@
+2013-01-23  Seulgi Kim  <[email protected]>
+
+        Coordinated Graphics : Reduce the number of calls to Functional and number of IPC messages by sending the created/deleted layers in a vector.
+        https://bugs.webkit.org/show_bug.cgi?id=107625
+
+        Reviewed by Benjamin Poulain.
+
+        Currently, the number of messages sent by CoordinatedLayerTreeHost is
+        equal to the number of layers created/deleted even though they requested
+        in the same cycle.
+        It's not good since CoreIPC creates functional before sending messages,
+        and CoordinatedLayerTreeHostProxy creates functional before
+        create/delete layers.
+
+        This patch makes CoordinatedLayerTreeHost send just one
+        CreateCompositingLayers message and CoordinatedLayerTreeHostProxy create
+        just one functional in a cycle. The same work has been done with
+        DeleteCompositingLayers message.
+
+        This patch will reduce the number of calls to Functional and number of
+        IPC messages by sending the created/deleted layers in a vector.
+
+        No new tests, no change in behavior.
+
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
+        (WebKit::CoordinatedLayerTreeHostProxy::createCompositingLayers):
+        (WebKit::CoordinatedLayerTreeHostProxy::deleteCompositingLayers):
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
+        (CoordinatedLayerTreeHostProxy):
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
+        (WebKit::LayerTreeRenderer::createLayers):
+        (WebKit):
+        (WebKit::LayerTreeRenderer::deleteLayers):
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
+        (LayerTreeRenderer):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        (WebKit::CoordinatedLayerTreeHost::createCompositingLayers):
+        (WebKit::CoordinatedLayerTreeHost::deleteCompositingLayers):
+
 2013-01-23  Huang Dongsung  <[email protected]>
 
         Coordinated Graphics: Add LegacyReceiver to messages.in files.

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp (140633 => 140634)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp	2013-01-24 02:55:32 UTC (rev 140633)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp	2013-01-24 02:57:46 UTC (rev 140634)
@@ -95,14 +95,14 @@
     m_surfaces.remove(atlasID);
 }
 
-void CoordinatedLayerTreeHostProxy::createCompositingLayer(CoordinatedLayerID id)
+void CoordinatedLayerTreeHostProxy::createCompositingLayers(const Vector<CoordinatedLayerID>& ids)
 {
-    dispatchUpdate(bind(&LayerTreeRenderer::createLayer, m_renderer.get(), id));
+    dispatchUpdate(bind(&LayerTreeRenderer::createLayers, m_renderer.get(), ids));
 }
 
-void CoordinatedLayerTreeHostProxy::deleteCompositingLayer(CoordinatedLayerID id)
+void CoordinatedLayerTreeHostProxy::deleteCompositingLayers(const Vector<CoordinatedLayerID>& ids)
 {
-    dispatchUpdate(bind(&LayerTreeRenderer::deleteLayer, m_renderer.get(), id));
+    dispatchUpdate(bind(&LayerTreeRenderer::deleteLayers, m_renderer.get(), ids));
 }
 
 void CoordinatedLayerTreeHostProxy::setRootCompositingLayer(CoordinatedLayerID id)

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h (140633 => 140634)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h	2013-01-24 02:55:32 UTC (rev 140633)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h	2013-01-24 02:57:46 UTC (rev 140634)
@@ -39,6 +39,7 @@
 #include <WebCore/Timer.h>
 #include <wtf/Functional.h>
 #include <wtf/HashSet.h>
+#include <wtf/Vector.h>
 
 namespace WebKit {
 
@@ -60,8 +61,8 @@
     void createCustomFilterProgram(int id, const WebCore::CustomFilterProgramInfo&);
     void removeCustomFilterProgram(int id);
 #endif
-    void createCompositingLayer(CoordinatedLayerID);
-    void deleteCompositingLayer(CoordinatedLayerID);
+    void createCompositingLayers(const Vector<CoordinatedLayerID>&);
+    void deleteCompositingLayers(const Vector<CoordinatedLayerID>&);
     void setRootCompositingLayer(CoordinatedLayerID);
     void setContentsSize(const WebCore::FloatSize&);
     void setVisibleContentsRect(const WebCore::FloatRect&, float pageScaleFactor, const WebCore::FloatPoint& trajectoryVector);

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in (140633 => 140634)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in	2013-01-24 02:55:32 UTC (rev 140633)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in	2013-01-24 02:57:46 UTC (rev 140634)
@@ -29,8 +29,8 @@
     RemoveCustomFilterProgram(int id)
 #endif
     SetRootCompositingLayer(uint32_t id)
-    CreateCompositingLayer(uint32_t id)
-    DeleteCompositingLayer(uint32_t id)
+    CreateCompositingLayers(Vector<uint32_t> ids)
+    DeleteCompositingLayers(Vector<uint32_t> ids)
     CreateTileForLayer(uint32_t layerID, uint32_t tileID, WebCore::IntRect tileRect, WebKit::SurfaceUpdateInfo updateInfo)
     UpdateTileForLayer(uint32_t layerID, uint32_t tileID, WebCore::IntRect tileRect, WebKit::SurfaceUpdateInfo updateInfo)
     RemoveTileForLayer(uint32_t layerID, uint32_t tileID)

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp (140633 => 140634)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-24 02:55:32 UTC (rev 140633)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-24 02:57:46 UTC (rev 140634)
@@ -353,6 +353,12 @@
     return (id != InvalidCoordinatedLayerID) ? layerByID(id) : 0;
 }
 
+void LayerTreeRenderer::createLayers(const Vector<CoordinatedLayerID>& ids)
+{
+    for (size_t index = 0; index < ids.size(); ++index)
+        createLayer(ids[index]);
+}
+
 void LayerTreeRenderer::createLayer(CoordinatedLayerID id)
 {
     OwnPtr<WebCore::GraphicsLayer> newLayer = GraphicsLayer::create(0 /* factory */, this);
@@ -360,6 +366,12 @@
     m_layers.add(id, newLayer.release());
 }
 
+void LayerTreeRenderer::deleteLayers(const Vector<CoordinatedLayerID>& layerIDs)
+{
+    for (size_t index = 0; index < layerIDs.size(); ++index)
+        deleteLayer(layerIDs[index]);
+}
+
 void LayerTreeRenderer::deleteLayer(CoordinatedLayerID layerID)
 {
     OwnPtr<GraphicsLayer> layer = m_layers.take(layerID);

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h (140633 => 140634)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h	2013-01-24 02:55:32 UTC (rev 140633)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h	2013-01-24 02:57:46 UTC (rev 140634)
@@ -37,6 +37,7 @@
 #include <wtf/Functional.h>
 #include <wtf/HashSet.h>
 #include <wtf/ThreadingPrimitives.h>
+#include <wtf/Vector.h>
 
 namespace WebCore {
 class CustomFilterProgram;
@@ -86,8 +87,8 @@
     void purgeGLResources();
     void setActive(bool);
 
-    void createLayer(CoordinatedLayerID);
-    void deleteLayer(CoordinatedLayerID);
+    void createLayers(const Vector<CoordinatedLayerID>&);
+    void deleteLayers(const Vector<CoordinatedLayerID>&);
     void setRootLayerID(CoordinatedLayerID);
     void setLayerChildren(CoordinatedLayerID, const Vector<CoordinatedLayerID>&);
     void setLayerState(CoordinatedLayerID, const CoordinatedLayerInfo&);
@@ -143,6 +144,9 @@
     void renderNextFrame();
     void purgeBackingStores();
 
+    void createLayer(CoordinatedLayerID);
+    void deleteLayer(CoordinatedLayerID);
+
     void assignImageBackingToLayer(WebCore::GraphicsLayer*, CoordinatedImageBackingID);
     void removeReleasedImageBackingsIfNeeded();
     void ensureRootLayer();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp (140633 => 140634)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2013-01-24 02:55:32 UTC (rev 140633)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2013-01-24 02:57:46 UTC (rev 140634)
@@ -318,8 +318,7 @@
         }
     }
 
-    for (size_t i = 0; i < m_layersToCreate.size(); ++i)
-        m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CreateCompositingLayer(m_layersToCreate[i]));
+    m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CreateCompositingLayers(m_layersToCreate));
     m_layersToCreate.clear();
     m_shouldSyncFrame = true;
 }
@@ -334,8 +333,7 @@
         return;
     }
 
-    for (size_t i = 0; i < m_layersToDelete.size(); ++i)
-        m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DeleteCompositingLayer(m_layersToDelete[i]));
+    m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DeleteCompositingLayers(m_layersToDelete));
     m_layersToDelete.clear();
     m_shouldSyncFrame = true;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to