Changeset 141325 in webkit


Ignore:
Timestamp:
Jan 30, 2013 3:00:20 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Huang Dongsung <luxtella@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):

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r141322 r141325  
     12013-01-30  Huang Dongsung  <luxtella@company100.net>
     2
     3        Coordinated Graphics: LayerTreeRenderer manages the surface of UpdateAtlas.
     4        https://bugs.webkit.org/show_bug.cgi?id=107224
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Currently, CoordinatedLayerTreeHostProxy manages the surface of UpdateAtlas, but
     9        all other resources are managed by LayerTreeRenderer. This patch matches the
     10        surface of UpdateAtlas to other resources.
     11
     12        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
     13        (WebKit::CoordinatedLayerTreeHostProxy::updateTileForLayer):
     14        (WebKit::CoordinatedLayerTreeHostProxy::createUpdateAtlas):
     15        (WebKit::CoordinatedLayerTreeHostProxy::removeUpdateAtlas):
     16        (WebKit::CoordinatedLayerTreeHostProxy::purgeBackingStores):
     17        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
     18        (CoordinatedLayerTreeHostProxy):
     19        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
     20        (WebKit::LayerTreeRenderer::updateTile):
     21        (WebKit::LayerTreeRenderer::createUpdateAtlas):
     22        (WebKit):
     23        (WebKit::LayerTreeRenderer::removeUpdateAtlas):
     24        (WebKit::LayerTreeRenderer::purgeGLResources):
     25        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
     26        (TileUpdate):
     27        (WebKit::LayerTreeRenderer::TileUpdate::TileUpdate):
     28        (LayerTreeRenderer):
     29
    1302013-01-30  Anders Carlsson  <andersca@apple.com>
    231
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp

    r141310 r141325  
    6868void CoordinatedLayerTreeHostProxy::updateTileForLayer(CoordinatedLayerID layerID, uint32_t tileID, const IntRect& tileRect, const WebKit::SurfaceUpdateInfo& updateInfo)
    6969{
    70     SurfaceMap::iterator it = m_surfaces.find(updateInfo.atlasID);
    71     ASSERT(it != m_surfaces.end());
    72     dispatchUpdate(bind(&LayerTreeRenderer::updateTile, m_renderer.get(), layerID, tileID, LayerTreeRenderer::TileUpdate(updateInfo.updateRect, tileRect, it->value, updateInfo.surfaceOffset)));
     70    dispatchUpdate(bind(&LayerTreeRenderer::updateTile, m_renderer.get(), layerID, tileID, LayerTreeRenderer::TileUpdate(updateInfo.updateRect, tileRect, updateInfo.atlasID, updateInfo.surfaceOffset)));
    7371}
    7472
     
    8078void CoordinatedLayerTreeHostProxy::createUpdateAtlas(uint32_t atlasID, const WebCoordinatedSurface::Handle& handle)
    8179{
    82     ASSERT(!m_surfaces.contains(atlasID));
    83     m_surfaces.add(atlasID, WebCoordinatedSurface::create(handle));
     80    dispatchUpdate(bind(&LayerTreeRenderer::createUpdateAtlas, m_renderer.get(), atlasID, WebCoordinatedSurface::create(handle)));
    8481}
    8582
    8683void CoordinatedLayerTreeHostProxy::removeUpdateAtlas(uint32_t atlasID)
    8784{
    88     ASSERT(m_surfaces.contains(atlasID));
    89     m_surfaces.remove(atlasID);
     85    dispatchUpdate(bind(&LayerTreeRenderer::removeUpdateAtlas, m_renderer.get(), atlasID));
    9086}
    9187
     
    241237void CoordinatedLayerTreeHostProxy::purgeBackingStores()
    242238{
    243     m_surfaces.clear();
    244239    m_drawingAreaProxy->page()->process()->send(Messages::CoordinatedLayerTreeHost::PurgeBackingStores(), m_drawingAreaProxy->page()->pageID());
    245240}
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h

    r141310 r141325  
    104104    WebCore::FloatRect m_lastSentVisibleRect;
    105105    WebCore::FloatPoint m_lastSentTrajectoryVector;
    106     typedef HashMap<uint32_t /* atlasID */, RefPtr<CoordinatedSurface> > SurfaceMap;
    107     SurfaceMap m_surfaces;
    108106};
    109107
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp

    r141232 r141325  
    469469    RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(layer);
    470470    ASSERT(backingStore);
    471     backingStore->updateTile(tileID, update.sourceRect, update.tileRect, update.surface, update.offset);
     471
     472    SurfaceMap::iterator it = m_surfaces.find(update.atlasID);
     473    ASSERT(it != m_surfaces.end());
     474
     475    backingStore->updateTile(tileID, update.sourceRect, update.tileRect, it->value, update.offset);
    472476    resetBackingStoreSizeToLayerSize(layer);
    473477    m_backingStoresWithPendingBuffers.add(backingStore);
     478}
     479
     480void LayerTreeRenderer::createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface> surface)
     481{
     482    ASSERT(!m_surfaces.contains(atlasID));
     483    m_surfaces.add(atlasID, surface);
     484}
     485
     486void LayerTreeRenderer::removeUpdateAtlas(uint32_t atlasID)
     487{
     488    ASSERT(m_surfaces.contains(atlasID));
     489    m_surfaces.remove(atlasID);
    474490}
    475491
     
    602618    m_surfaceBackingStores.clear();
    603619#endif
     620    m_surfaces.clear();
    604621
    605622    m_rootLayer.clear();
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h

    r141232 r141325  
    5757        WebCore::IntRect sourceRect;
    5858        WebCore::IntRect tileRect;
    59         RefPtr<CoordinatedSurface> surface;
     59        uint32_t atlasID;
    6060        WebCore::IntPoint offset;
    61         TileUpdate(const WebCore::IntRect& source, const WebCore::IntRect& tile, PassRefPtr<CoordinatedSurface> newSurface, const WebCore::IntPoint& newOffset)
     61        TileUpdate(const WebCore::IntRect& source, const WebCore::IntRect& tile, uint32_t atlas, const WebCore::IntPoint& newOffset)
    6262            : sourceRect(source)
    6363            , tileRect(tile)
    64             , surface(newSurface)
     64            , atlasID(atlas)
    6565            , offset(newOffset)
    6666        {
     
    106106    void removeTile(CoordinatedLayerID, uint32_t tileID);
    107107    void updateTile(CoordinatedLayerID, uint32_t tileID, const TileUpdate&);
     108    void createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface>);
     109    void removeUpdateAtlas(uint32_t atlasID);
    108110    void flushLayerChanges();
    109111    void createImageBacking(CoordinatedImageBackingID);
     
    181183    SurfaceBackingStoreMap m_surfaceBackingStores;
    182184#endif
     185
     186    typedef HashMap<uint32_t /* atlasID */, RefPtr<CoordinatedSurface> > SurfaceMap;
     187    SurfaceMap m_surfaces;
    183188
    184189    // Below two members are accessed by only the main thread. The painting thread must lock the main thread to access both members.
Note: See TracChangeset for help on using the changeset viewer.