Title: [141325] trunk/Source/WebKit2
Revision
141325
Author
commit-qu...@webkit.org
Date
2013-01-30 15:00:20 -0800 (Wed, 30 Jan 2013)

Log Message

Coordinated Graphics: LayerTreeRenderer manages the surface of UpdateAtlas.
https://bugs.webkit.org/show_bug.cgi?id=107224

Patch by Huang Dongsung <luxte...@company100.net> on 2013-01-30
Reviewed by Benjamin Poulain.

Currently, CoordinatedLayerTreeHostProxy manages the surface of UpdateAtlas, but
all other resources are managed by LayerTreeRenderer. This patch matches the
surface of UpdateAtlas to other resources.

* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
(WebKit::CoordinatedLayerTreeHostProxy::updateTileForLayer):
(WebKit::CoordinatedLayerTreeHostProxy::createUpdateAtlas):
(WebKit::CoordinatedLayerTreeHostProxy::removeUpdateAtlas):
(WebKit::CoordinatedLayerTreeHostProxy::purgeBackingStores):
* UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
(CoordinatedLayerTreeHostProxy):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::updateTile):
(WebKit::LayerTreeRenderer::createUpdateAtlas):
(WebKit):
(WebKit::LayerTreeRenderer::removeUpdateAtlas):
(WebKit::LayerTreeRenderer::purgeGLResources):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(TileUpdate):
(WebKit::LayerTreeRenderer::TileUpdate::TileUpdate):
(LayerTreeRenderer):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (141324 => 141325)


--- trunk/Source/WebKit2/ChangeLog	2013-01-30 22:58:08 UTC (rev 141324)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-30 23:00:20 UTC (rev 141325)
@@ -1,3 +1,32 @@
+2013-01-30  Huang Dongsung  <luxte...@company100.net>
+
+        Coordinated Graphics: LayerTreeRenderer manages the surface of UpdateAtlas.
+        https://bugs.webkit.org/show_bug.cgi?id=107224
+
+        Reviewed by Benjamin Poulain.
+
+        Currently, CoordinatedLayerTreeHostProxy manages the surface of UpdateAtlas, but
+        all other resources are managed by LayerTreeRenderer. This patch matches the
+        surface of UpdateAtlas to other resources.
+
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
+        (WebKit::CoordinatedLayerTreeHostProxy::updateTileForLayer):
+        (WebKit::CoordinatedLayerTreeHostProxy::createUpdateAtlas):
+        (WebKit::CoordinatedLayerTreeHostProxy::removeUpdateAtlas):
+        (WebKit::CoordinatedLayerTreeHostProxy::purgeBackingStores):
+        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
+        (CoordinatedLayerTreeHostProxy):
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
+        (WebKit::LayerTreeRenderer::updateTile):
+        (WebKit::LayerTreeRenderer::createUpdateAtlas):
+        (WebKit):
+        (WebKit::LayerTreeRenderer::removeUpdateAtlas):
+        (WebKit::LayerTreeRenderer::purgeGLResources):
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
+        (TileUpdate):
+        (WebKit::LayerTreeRenderer::TileUpdate::TileUpdate):
+        (LayerTreeRenderer):
+
 2013-01-30  Anders Carlsson  <ander...@apple.com>
 
         Remove MessageID parameter from generated message receivers

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp (141324 => 141325)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp	2013-01-30 22:58:08 UTC (rev 141324)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp	2013-01-30 23:00:20 UTC (rev 141325)
@@ -67,9 +67,7 @@
 
 void CoordinatedLayerTreeHostProxy::updateTileForLayer(CoordinatedLayerID layerID, uint32_t tileID, const IntRect& tileRect, const WebKit::SurfaceUpdateInfo& updateInfo)
 {
-    SurfaceMap::iterator it = m_surfaces.find(updateInfo.atlasID);
-    ASSERT(it != m_surfaces.end());
-    dispatchUpdate(bind(&LayerTreeRenderer::updateTile, m_renderer.get(), layerID, tileID, LayerTreeRenderer::TileUpdate(updateInfo.updateRect, tileRect, it->value, updateInfo.surfaceOffset)));
+    dispatchUpdate(bind(&LayerTreeRenderer::updateTile, m_renderer.get(), layerID, tileID, LayerTreeRenderer::TileUpdate(updateInfo.updateRect, tileRect, updateInfo.atlasID, updateInfo.surfaceOffset)));
 }
 
 void CoordinatedLayerTreeHostProxy::removeTileForLayer(CoordinatedLayerID layerID, uint32_t tileID)
@@ -79,14 +77,12 @@
 
 void CoordinatedLayerTreeHostProxy::createUpdateAtlas(uint32_t atlasID, const WebCoordinatedSurface::Handle& handle)
 {
-    ASSERT(!m_surfaces.contains(atlasID));
-    m_surfaces.add(atlasID, WebCoordinatedSurface::create(handle));
+    dispatchUpdate(bind(&LayerTreeRenderer::createUpdateAtlas, m_renderer.get(), atlasID, WebCoordinatedSurface::create(handle)));
 }
 
 void CoordinatedLayerTreeHostProxy::removeUpdateAtlas(uint32_t atlasID)
 {
-    ASSERT(m_surfaces.contains(atlasID));
-    m_surfaces.remove(atlasID);
+    dispatchUpdate(bind(&LayerTreeRenderer::removeUpdateAtlas, m_renderer.get(), atlasID));
 }
 
 void CoordinatedLayerTreeHostProxy::createCompositingLayers(const Vector<CoordinatedLayerID>& ids)
@@ -240,7 +236,6 @@
 
 void CoordinatedLayerTreeHostProxy::purgeBackingStores()
 {
-    m_surfaces.clear();
     m_drawingAreaProxy->page()->process()->send(Messages::CoordinatedLayerTreeHost::PurgeBackingStores(), m_drawingAreaProxy->page()->pageID());
 }
 

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h (141324 => 141325)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h	2013-01-30 22:58:08 UTC (rev 141324)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h	2013-01-30 23:00:20 UTC (rev 141325)
@@ -103,8 +103,6 @@
     RefPtr<LayerTreeRenderer> m_renderer;
     WebCore::FloatRect m_lastSentVisibleRect;
     WebCore::FloatPoint m_lastSentTrajectoryVector;
-    typedef HashMap<uint32_t /* atlasID */, RefPtr<CoordinatedSurface> > SurfaceMap;
-    SurfaceMap m_surfaces;
 };
 
 }

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp (141324 => 141325)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-30 22:58:08 UTC (rev 141324)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp	2013-01-30 23:00:20 UTC (rev 141325)
@@ -468,11 +468,27 @@
     GraphicsLayer* layer = layerByID(layerID);
     RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(layer);
     ASSERT(backingStore);
-    backingStore->updateTile(tileID, update.sourceRect, update.tileRect, update.surface, update.offset);
+
+    SurfaceMap::iterator it = m_surfaces.find(update.atlasID);
+    ASSERT(it != m_surfaces.end());
+
+    backingStore->updateTile(tileID, update.sourceRect, update.tileRect, it->value, update.offset);
     resetBackingStoreSizeToLayerSize(layer);
     m_backingStoresWithPendingBuffers.add(backingStore);
 }
 
+void LayerTreeRenderer::createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface> surface)
+{
+    ASSERT(!m_surfaces.contains(atlasID));
+    m_surfaces.add(atlasID, surface);
+}
+
+void LayerTreeRenderer::removeUpdateAtlas(uint32_t atlasID)
+{
+    ASSERT(m_surfaces.contains(atlasID));
+    m_surfaces.remove(atlasID);
+}
+
 void LayerTreeRenderer::createImageBacking(CoordinatedImageBackingID imageID)
 {
     ASSERT(!m_imageBackings.contains(imageID));
@@ -601,6 +617,7 @@
 #if USE(GRAPHICS_SURFACE)
     m_surfaceBackingStores.clear();
 #endif
+    m_surfaces.clear();
 
     m_rootLayer.clear();
     m_rootLayerID = InvalidCoordinatedLayerID;

Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h (141324 => 141325)


--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h	2013-01-30 22:58:08 UTC (rev 141324)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h	2013-01-30 23:00:20 UTC (rev 141325)
@@ -56,12 +56,12 @@
     struct TileUpdate {
         WebCore::IntRect sourceRect;
         WebCore::IntRect tileRect;
-        RefPtr<CoordinatedSurface> surface;
+        uint32_t atlasID;
         WebCore::IntPoint offset;
-        TileUpdate(const WebCore::IntRect& source, const WebCore::IntRect& tile, PassRefPtr<CoordinatedSurface> newSurface, const WebCore::IntPoint& newOffset)
+        TileUpdate(const WebCore::IntRect& source, const WebCore::IntRect& tile, uint32_t atlas, const WebCore::IntPoint& newOffset)
             : sourceRect(source)
             , tileRect(tile)
-            , surface(newSurface)
+            , atlasID(atlas)
             , offset(newOffset)
         {
         }
@@ -105,6 +105,8 @@
     void createTile(CoordinatedLayerID, uint32_t tileID, float scale);
     void removeTile(CoordinatedLayerID, uint32_t tileID);
     void updateTile(CoordinatedLayerID, uint32_t tileID, const TileUpdate&);
+    void createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface>);
+    void removeUpdateAtlas(uint32_t atlasID);
     void flushLayerChanges();
     void createImageBacking(CoordinatedImageBackingID);
     void updateImageBacking(CoordinatedImageBackingID, PassRefPtr<CoordinatedSurface>);
@@ -181,6 +183,9 @@
     SurfaceBackingStoreMap m_surfaceBackingStores;
 #endif
 
+    typedef HashMap<uint32_t /* atlasID */, RefPtr<CoordinatedSurface> > SurfaceMap;
+    SurfaceMap m_surfaces;
+
     // Below two members are accessed by only the main thread. The painting thread must lock the main thread to access both members.
     CoordinatedLayerTreeHostProxy* m_coordinatedLayerTreeHostProxy;
     bool m_isActive;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to