Changeset 152183 in webkit


Ignore:
Timestamp:
Jun 28, 2013 12:09:52 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Coordinated Graphics: Separate CoordinatedLayerTreeHost into CoordinatedLayerTreeHost and CompositingCoordinator
https://bugs.webkit.org/show_bug.cgi?id=104360

Patch by Gwang Yoon Hwang <ryumiel@company100.net> on 2013-06-28
Reviewed by Noam Rosenthal.

The CoordinatedLayerTreeHost has too many responsibilities. It
implements LayerTreeHost, GraphicsLayerClient,
CoordinatedGraphicsLayerClient, CoordinatedImageBacking::Client,
UpdateAtlas::Client, GraphicsLayerFactory and
WebCustomFilterProgramProxyClient.

This refactoring reduces the responsibilities of CoordinatedLayerTreeHost.

This patch introduces a new class called CompositingCoordinator, which
takes the responsibility of managing compositing resources in
WebProcess.

CoordinatedLayerTreeHost is responsible only for the scheduling and
IPC-specific stuff, which are relevant only for WebKit2.

No new tests, covered by existing tests.

Source/WebCore:

  • CMakeLists.txt:
  • Target.pri:
  • platform/graphics/texmap/coordinated/CompositingCoordinator.cpp: Added.

(WebCore::CompositingCoordinator::create):
(WebCore::CompositingCoordinator::~CompositingCoordinator):
(WebCore::CompositingCoordinator::CompositingCoordinator):
(WebCore::CompositingCoordinator::setRootCompositingLayer):
(WebCore::CompositingCoordinator::sizeDidChange):
(WebCore::CompositingCoordinator::flushPendingLayerChanges):
(WebCore::CompositingCoordinator::syncDisplayState):
(WebCore::CompositingCoordinator::nextAnimationServiceTime):
(WebCore::CompositingCoordinator::clearPendingStateChanges):
(WebCore::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
(WebCore::CompositingCoordinator::createRootLayer):
(WebCore::CompositingCoordinator::syncLayerState):
(WebCore::CompositingCoordinator::createImageBackingIfNeeded):
(WebCore::CompositingCoordinator::createImageBacking):
(WebCore::CompositingCoordinator::updateImageBacking):
(WebCore::CompositingCoordinator::clearImageBackingContents):
(WebCore::CompositingCoordinator::removeImageBacking):
(WebCore::CompositingCoordinator::flushPendingImageBackingChanges):
(WebCore::CompositingCoordinator::notifyAnimationStarted):
(WebCore::CompositingCoordinator::notifyFlushRequired):
(WebCore::CompositingCoordinator::paintContents):
(WebCore::CompositingCoordinator::createGraphicsLayer):
(WebCore::CompositingCoordinator::deviceScaleFactor):
(WebCore::CompositingCoordinator::pageScaleFactor):
(WebCore::CompositingCoordinator::createUpdateAtlas):
(WebCore::CompositingCoordinator::removeUpdateAtlas):
(WebCore::CompositingCoordinator::visibleContentsRect):
(WebCore::CompositingCoordinator::mainContentsLayer):
(WebCore::CompositingCoordinator::setVisibleContentsRect):
(WebCore::CompositingCoordinator::deviceOrPageScaleFactorChanged):
(WebCore::CompositingCoordinator::detachLayer):
(WebCore::CompositingCoordinator::commitScrollOffset):
(WebCore::CompositingCoordinator::renderNextFrame):
(WebCore::CompositingCoordinator::purgeBackingStores):
(WebCore::CompositingCoordinator::paintToSurface):
(WebCore::CompositingCoordinator::scheduleReleaseInactiveAtlases):
(WebCore::CompositingCoordinator::releaseInactiveAtlasesTimerFired):

  • platform/graphics/texmap/coordinated/CompositingCoordinator.h: Added.

(WebCore::CompositingCoordinator::clearRootLayer):
(WebCore::CompositingCoordinator::rootLayer):
(WebCore::CompositingCoordinator::state):

Source/WebKit2:

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:

(WebKit::CoordinatedLayerTreeHost::~CoordinatedLayerTreeHost):
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
(WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
(WebKit::CoordinatedLayerTreeHost::invalidate):
(WebKit::CoordinatedLayerTreeHost::forceRepaint):
(WebKit::CoordinatedLayerTreeHost::sizeDidChange):
(WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
(WebKit::CoordinatedLayerTreeHost::renderNextFrame):
(WebKit::CoordinatedLayerTreeHost::purgeBackingStores):
(WebKit::CoordinatedLayerTreeHost::willSyncLayerState):
(WebKit::CoordinatedLayerTreeHost::prepareCustomFilterProxiesForAnimations):
(WebKit::CoordinatedLayerTreeHost::checkCustomFilterProgramProxies):
(WebKit::CoordinatedLayerTreeHost::removeCustomFilterProgramProxy):
(WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
(WebKit::CoordinatedLayerTreeHost::performScheduledLayerFlush):
(WebKit::CoordinatedLayerTreeHost::createPageOverlayLayer):
(WebKit::CoordinatedLayerTreeHost::paintLayerContents):
(WebKit::CoordinatedLayerTreeHost::commitSceneState):
(WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory):
(WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
(WebKit::CoordinatedLayerTreeHost::commitScrollOffset):

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
  • WebProcess/WebPage/LayerTreeHost.h:
Location:
trunk/Source
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r152167 r152183  
    19821982
    19831983    platform/graphics/texmap/coordinated/AreaAllocator.cpp
     1984    platform/graphics/texmap/coordinated/CompositingCoordinator.cpp
    19841985    platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp
    19851986    platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
  • trunk/Source/WebCore/ChangeLog

    r152181 r152183  
     12013-06-28  Gwang Yoon Hwang  <ryumiel@company100.net>
     2
     3        Coordinated Graphics: Separate CoordinatedLayerTreeHost into CoordinatedLayerTreeHost and CompositingCoordinator
     4        https://bugs.webkit.org/show_bug.cgi?id=104360
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        The CoordinatedLayerTreeHost has too many responsibilities. It
     9        implements LayerTreeHost, GraphicsLayerClient,
     10        CoordinatedGraphicsLayerClient, CoordinatedImageBacking::Client,
     11        UpdateAtlas::Client, GraphicsLayerFactory and
     12        WebCustomFilterProgramProxyClient.
     13
     14        This refactoring reduces the responsibilities of CoordinatedLayerTreeHost.
     15
     16        This patch introduces a new class called CompositingCoordinator, which
     17        takes the responsibility of managing compositing resources in
     18        WebProcess.
     19
     20        CoordinatedLayerTreeHost is responsible only for the scheduling and
     21        IPC-specific stuff, which are relevant only for WebKit2.
     22
     23        No new tests, covered by existing tests.
     24
     25        * CMakeLists.txt:
     26        * Target.pri:
     27        * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp: Added.
     28        (WebCore::CompositingCoordinator::create):
     29        (WebCore::CompositingCoordinator::~CompositingCoordinator):
     30        (WebCore::CompositingCoordinator::CompositingCoordinator):
     31        (WebCore::CompositingCoordinator::setRootCompositingLayer):
     32        (WebCore::CompositingCoordinator::sizeDidChange):
     33        (WebCore::CompositingCoordinator::flushPendingLayerChanges):
     34        (WebCore::CompositingCoordinator::syncDisplayState):
     35        (WebCore::CompositingCoordinator::nextAnimationServiceTime):
     36        (WebCore::CompositingCoordinator::clearPendingStateChanges):
     37        (WebCore::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
     38        (WebCore::CompositingCoordinator::createRootLayer):
     39        (WebCore::CompositingCoordinator::syncLayerState):
     40        (WebCore::CompositingCoordinator::createImageBackingIfNeeded):
     41        (WebCore::CompositingCoordinator::createImageBacking):
     42        (WebCore::CompositingCoordinator::updateImageBacking):
     43        (WebCore::CompositingCoordinator::clearImageBackingContents):
     44        (WebCore::CompositingCoordinator::removeImageBacking):
     45        (WebCore::CompositingCoordinator::flushPendingImageBackingChanges):
     46        (WebCore::CompositingCoordinator::notifyAnimationStarted):
     47        (WebCore::CompositingCoordinator::notifyFlushRequired):
     48        (WebCore::CompositingCoordinator::paintContents):
     49        (WebCore::CompositingCoordinator::createGraphicsLayer):
     50        (WebCore::CompositingCoordinator::deviceScaleFactor):
     51        (WebCore::CompositingCoordinator::pageScaleFactor):
     52        (WebCore::CompositingCoordinator::createUpdateAtlas):
     53        (WebCore::CompositingCoordinator::removeUpdateAtlas):
     54        (WebCore::CompositingCoordinator::visibleContentsRect):
     55        (WebCore::CompositingCoordinator::mainContentsLayer):
     56        (WebCore::CompositingCoordinator::setVisibleContentsRect):
     57        (WebCore::CompositingCoordinator::deviceOrPageScaleFactorChanged):
     58        (WebCore::CompositingCoordinator::detachLayer):
     59        (WebCore::CompositingCoordinator::commitScrollOffset):
     60        (WebCore::CompositingCoordinator::renderNextFrame):
     61        (WebCore::CompositingCoordinator::purgeBackingStores):
     62        (WebCore::CompositingCoordinator::paintToSurface):
     63        (WebCore::CompositingCoordinator::scheduleReleaseInactiveAtlases):
     64        (WebCore::CompositingCoordinator::releaseInactiveAtlasesTimerFired):
     65        * platform/graphics/texmap/coordinated/CompositingCoordinator.h: Added.
     66        (WebCore::CompositingCoordinator::clearRootLayer):
     67        (WebCore::CompositingCoordinator::rootLayer):
     68        (WebCore::CompositingCoordinator::state):
     69
    1702013-06-28  Commit Queue  <commit-queue@webkit.org>
    271
  • trunk/Source/WebCore/Target.pri

    r152175 r152183  
    40874087        platform/graphics/texmap/TextureMapperShaderProgram.h \
    40884088        platform/graphics/texmap/coordinated/AreaAllocator.h \
     4089        platform/graphics/texmap/coordinated/CompositingCoordinator.h \
    40894090        platform/graphics/texmap/coordinated/CoordinatedBackingStore.h \
    40904091        platform/graphics/texmap/coordinated/CoordinatedCustomFilterOperation.h \
     
    41224123        platform/graphics/texmap/TextureMapperShaderProgram.cpp \
    41234124        platform/graphics/texmap/coordinated/AreaAllocator.cpp \
     4125        platform/graphics/texmap/coordinated/CompositingCoordinator.cpp \
    41244126        platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp \
    41254127        platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp \
  • trunk/Source/WebKit2/ChangeLog

    r152182 r152183  
     12013-06-28  Gwang Yoon Hwang  <ryumiel@company100.net>
     2
     3        Coordinated Graphics: Separate CoordinatedLayerTreeHost into CoordinatedLayerTreeHost and CompositingCoordinator
     4        https://bugs.webkit.org/show_bug.cgi?id=104360
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        The CoordinatedLayerTreeHost has too many responsibilities. It
     9        implements LayerTreeHost, GraphicsLayerClient,
     10        CoordinatedGraphicsLayerClient, CoordinatedImageBacking::Client,
     11        UpdateAtlas::Client, GraphicsLayerFactory and
     12        WebCustomFilterProgramProxyClient.
     13
     14        This refactoring reduces the responsibilities of CoordinatedLayerTreeHost.
     15
     16        This patch introduces a new class called CompositingCoordinator, which
     17        takes the responsibility of managing compositing resources in
     18        WebProcess.
     19
     20        CoordinatedLayerTreeHost is responsible only for the scheduling and
     21        IPC-specific stuff, which are relevant only for WebKit2.
     22
     23        No new tests, covered by existing tests.
     24
     25        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
     26        (WebKit::CoordinatedLayerTreeHost::~CoordinatedLayerTreeHost):
     27        (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
     28        (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
     29        (WebKit::CoordinatedLayerTreeHost::invalidate):
     30        (WebKit::CoordinatedLayerTreeHost::forceRepaint):
     31        (WebKit::CoordinatedLayerTreeHost::sizeDidChange):
     32        (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
     33        (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
     34        (WebKit::CoordinatedLayerTreeHost::purgeBackingStores):
     35        (WebKit::CoordinatedLayerTreeHost::willSyncLayerState):
     36        (WebKit::CoordinatedLayerTreeHost::prepareCustomFilterProxiesForAnimations):
     37        (WebKit::CoordinatedLayerTreeHost::checkCustomFilterProgramProxies):
     38        (WebKit::CoordinatedLayerTreeHost::removeCustomFilterProgramProxy):
     39        (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
     40        (WebKit::CoordinatedLayerTreeHost::performScheduledLayerFlush):
     41        (WebKit::CoordinatedLayerTreeHost::createPageOverlayLayer):
     42        (WebKit::CoordinatedLayerTreeHost::paintLayerContents):
     43        (WebKit::CoordinatedLayerTreeHost::commitSceneState):
     44        (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
     45        (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory):
     46        (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
     47        (WebKit::CoordinatedLayerTreeHost::commitScrollOffset):
     48        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
     49        * WebProcess/WebPage/LayerTreeHost.h:
     50
    1512013-06-28  Anders Carlsson  <andersca@apple.com>
    252
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp

    r152099 r152183  
    4141#include <WebCore/Frame.h>
    4242#include <WebCore/FrameView.h>
    43 #include <WebCore/GraphicsSurface.h>
    44 #include <WebCore/InspectorController.h>
    45 #include <WebCore/Page.h>
    46 #include <WebCore/RenderLayer.h>
    47 #include <WebCore/RenderLayerBacking.h>
    48 #include <WebCore/RenderLayerCompositor.h>
    49 #include <WebCore/RenderView.h>
    5043#include <WebCore/Settings.h>
    51 #include <WebCore/SurfaceUpdateInfo.h>
    52 #include <WebCore/TextureMapperPlatformLayer.h>
    5344#include <wtf/CurrentTime.h>
    54 #include <wtf/TemporaryChange.h>
    5545
    5646#if ENABLE(CSS_SHADERS)
     
    7363    disconnectCustomFilterPrograms();
    7464#endif
    75     purgeBackingStores();
    76 
    77     LayerMap::iterator end = m_registeredLayers.end();
    78     for (LayerMap::iterator it = m_registeredLayers.begin(); it != end; ++it)
    79         it->value->setCoordinator(0);
    8065}
    8166
    8267CoordinatedLayerTreeHost::CoordinatedLayerTreeHost(WebPage* webPage)
    8368    : LayerTreeHost(webPage)
    84     , m_rootCompositingLayer(0)
    8569    , m_notifyAfterScheduledLayerFlush(false)
    8670    , m_isValid(true)
    87     , m_isPurging(false)
    88     , m_isFlushingLayerChanges(false)
    89     , m_waitingForUIProcess(true)
    9071    , m_isSuspended(false)
    91     , m_shouldSyncFrame(false)
    92     , m_didInitializeRootCompositingLayer(false)
     72    , m_isWaitingForRenderer(true)
    9373    , m_layerFlushTimer(this, &CoordinatedLayerTreeHost::layerFlushTimerFired)
    94     , m_releaseInactiveAtlasesTimer(this, &CoordinatedLayerTreeHost::releaseInactiveAtlasesTimerFired)
    9574    , m_layerFlushSchedulingEnabled(true)
    9675    , m_forceRepaintAsyncCallbackID(0)
    97     , m_animationsLocked(false)
    98 #if ENABLE(REQUEST_ANIMATION_FRAME)
    99     , m_lastAnimationServiceTime(0)
    100 #endif
    101 {
    102     m_webPage->corePage()->settings()->setApplyDeviceScaleFactorInCompositor(true);
    103 
    104     // Create a root layer.
    105     m_rootLayer = GraphicsLayer::create(this, this);
    106 #ifndef NDEBUG
    107     m_rootLayer->setName("CoordinatedLayerTreeHost root layer");
    108 #endif
    109     m_rootLayer->setDrawsContent(false);
    110     m_rootLayer->setSize(m_webPage->size());
    111     m_layerTreeContext.coordinatedLayerID = toCoordinatedGraphicsLayer(m_rootLayer.get())->id();
     76{
     77    m_coordinator = CompositingCoordinator::create(webPage->corePage(), this);
     78
     79    m_coordinator->createRootLayer(webPage->size());
     80    m_layerTreeContext.coordinatedLayerID = toCoordinatedGraphicsLayer(m_coordinator->rootLayer())->id();
    11281
    11382    CoordinatedSurface::setFactory(createCoordinatedSurface);
    11483
    115     // This is a temporary way to enable this only in the GL case, until TextureMapperImageBuffer is removed.
    116     // See https://bugs.webkit.org/show_bug.cgi?id=114869
    117     CoordinatedGraphicsLayer::setShouldSupportContentsTiling(true);
    118 
    119     if (m_webPage->hasPageOverlay())
     84    if (webPage->hasPageOverlay())
    12085        createPageOverlayLayer();
    12186
     
    159124void CoordinatedLayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer)
    160125{
    161     if (m_rootCompositingLayer)
    162         m_rootCompositingLayer->removeFromParent();
    163 
    164     m_rootCompositingLayer = graphicsLayer;
    165     if (m_rootCompositingLayer)
    166         m_rootLayer->addChildAtIndex(m_rootCompositingLayer, 0);
     126    m_coordinator->setRootCompositingLayer(graphicsLayer);
    167127}
    168128
     
    172132
    173133    ASSERT(m_isValid);
    174     m_rootLayer = nullptr;
     134    m_coordinator->clearRootLayer();
    175135    m_isValid = false;
    176136}
     
    180140    // This is necessary for running layout tests. Since in this case we are not waiting for a UIProcess to reply nicely.
    181141    // Instead we are just triggering forceRepaint. But we still want to have the scripted animation callbacks being executed.
    182     syncDisplayState();
     142    m_coordinator->syncDisplayState();
    183143
    184144    // We need to schedule another flush, otherwise the forced paint might cancel a later expected flush.
    185145    // This is aligned with LayerTreeHostCA.
    186146    scheduleLayerFlush();
    187     flushPendingLayerChanges();
     147
     148    if (m_isWaitingForRenderer)
     149        return;
     150
     151    m_coordinator->flushPendingLayerChanges();
    188152}
    189153
     
    199163void CoordinatedLayerTreeHost::sizeDidChange(const WebCore::IntSize& newSize)
    200164{
    201     m_rootLayer->setSize(newSize);
     165    m_coordinator->sizeDidChange(newSize);
    202166    scheduleLayerFlush();
    203167}
     
    234198}
    235199
    236 bool CoordinatedLayerTreeHost::flushPendingLayerChanges()
    237 {
    238     if (m_waitingForUIProcess)
    239         return false;
    240 
    241     TemporaryChange<bool> protector(m_isFlushingLayerChanges, true);
    242 
    243     initializeRootCompositingLayerIfNeeded();
    244 
    245     m_rootLayer->flushCompositingStateForThisLayerOnly();
    246     if (m_pageOverlayLayer)
    247         m_pageOverlayLayer->flushCompositingStateForThisLayerOnly();
    248 
    249     bool didSync = m_webPage->corePage()->mainFrame()->view()->flushCompositingStateIncludingSubframes();
    250 
    251     toCoordinatedGraphicsLayer(m_rootLayer.get())->updateContentBuffersIncludingSubLayers();
    252     toCoordinatedGraphicsLayer(m_rootLayer.get())->syncPendingStateChangesIncludingSubLayers();
    253 
    254     flushPendingImageBackingChanges();
    255 
    256     if (m_shouldSyncFrame) {
    257         didSync = true;
    258 
    259         if (m_rootCompositingLayer) {
    260             m_state.contentsSize = roundedIntSize(m_rootCompositingLayer->size());
    261             if (CoordinatedGraphicsLayer* contentsLayer = mainContentsLayer())
    262                 m_state.coveredRect = contentsLayer->coverRect();
    263         }
    264 
    265         m_state.scrollPosition = m_visibleContentsRect.location();
    266 
    267         m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CommitCoordinatedGraphicsState(m_state));
    268 
    269         clearPendingStateChanges();
    270         m_waitingForUIProcess = true;
    271         m_shouldSyncFrame = false;
    272     }
    273 
    274     if (m_forceRepaintAsyncCallbackID) {
    275         m_webPage->send(Messages::WebPageProxy::VoidCallback(m_forceRepaintAsyncCallbackID));
    276         m_forceRepaintAsyncCallbackID = 0;
    277     }
    278 
    279     return didSync;
    280 }
    281 
    282 void CoordinatedLayerTreeHost::clearPendingStateChanges()
    283 {
    284     m_state.layersToCreate.clear();
    285     m_state.layersToUpdate.clear();
    286     m_state.layersToRemove.clear();
    287 
    288     m_state.imagesToCreate.clear();
    289     m_state.imagesToRemove.clear();
    290     m_state.imagesToUpdate.clear();
    291     m_state.imagesToClear.clear();
    292 
    293     m_state.updateAtlasesToCreate.clear();
    294     m_state.updateAtlasesToRemove.clear();
    295 
     200void CoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect& rect, const FloatPoint& trajectoryVector)
     201{
     202    m_coordinator->setVisibleContentsRect(rect, trajectoryVector);
     203    scheduleLayerFlush();
     204}
     205
     206void CoordinatedLayerTreeHost::renderNextFrame()
     207{
     208    m_isWaitingForRenderer = false;
     209    scheduleLayerFlush();
     210    m_coordinator->renderNextFrame();
     211}
     212
     213void CoordinatedLayerTreeHost::purgeBackingStores()
     214{
     215    m_coordinator->purgeBackingStores();
     216}
     217
     218void CoordinatedLayerTreeHost::willSyncLayerState(CoordinatedGraphicsLayerState& state)
     219{
    296220#if ENABLE(CSS_SHADERS)
    297     m_state.customFiltersToCreate.clear();
    298     m_state.customFiltersToRemove.clear();
    299 #endif
    300 }
    301 
    302 void CoordinatedLayerTreeHost::initializeRootCompositingLayerIfNeeded()
    303 {
    304     if (m_didInitializeRootCompositingLayer)
    305         return;
    306 
    307     m_state.rootCompositingLayer = toCoordinatedGraphicsLayer(m_rootLayer.get())->id();
    308     m_didInitializeRootCompositingLayer = true;
    309     m_shouldSyncFrame = true;
    310 }
    311 
    312 void CoordinatedLayerTreeHost::syncLayerState(CoordinatedLayerID id, CoordinatedGraphicsLayerState& state)
    313 {
    314     m_shouldSyncFrame = true;
    315 
    316 #if ENABLE(CSS_SHADERS)
    317     prepareCustomFilterProxiesIfNeeded(state);
    318 #endif
    319 
    320     m_state.layersToUpdate.append(std::make_pair(id, state));
    321 }
    322 
    323 #if ENABLE(CSS_SHADERS)
    324 void CoordinatedLayerTreeHost::prepareCustomFilterProxiesIfNeeded(CoordinatedGraphicsLayerState& state)
    325 {
    326     if (state.animationsChanged) {
    327         GraphicsLayerAnimations& activeAnimations = state.animations;
    328         for (size_t i = 0; i < activeAnimations.animations().size(); ++i) {
    329             const KeyframeValueList& keyframes = activeAnimations.animations().at(i).keyframes();
    330             if (keyframes.property() != AnimatedPropertyWebkitFilter)
    331                 continue;
    332             for (size_t j = 0; j < keyframes.size(); ++j) {
    333                 const FilterAnimationValue& filterValue = static_cast<const FilterAnimationValue&>(keyframes.at(j));
    334                 checkCustomFilterProgramProxies(filterValue.value());
    335             }
    336         }
    337     }
     221    if (state.animationsChanged)
     222        prepareCustomFilterProxiesForAnimations(state.animations);
    338223
    339224    if (state.filtersChanged)
    340225        checkCustomFilterProgramProxies(state.filters);
     226#else
     227    UNUSED_PARAM(state);
     228#endif
     229}
     230
     231#if ENABLE(CSS_SHADERS)
     232void CoordinatedLayerTreeHost::prepareCustomFilterProxiesForAnimations(GraphicsLayerAnimations& activeAnimations)
     233{
     234    for (size_t i = 0; i < activeAnimations.animations().size(); ++i) {
     235        const KeyframeValueList& keyframes = activeAnimations.animations().at(i).keyframes();
     236        if (keyframes.property() != AnimatedPropertyWebkitFilter)
     237            continue;
     238        for (size_t j = 0; j < keyframes.size(); ++j) {
     239            const FilterAnimationValue& filterValue = static_cast<const FilterAnimationValue&>(keyframes.at(j));
     240            checkCustomFilterProgramProxies(filterValue.value());
     241        }
     242    }
    341243}
    342244
     
    368270            customFilterProgramProxy->setClient(this);
    369271            m_customFilterPrograms.add(customFilterProgramProxy.get());
    370             m_state.customFiltersToCreate.append(std::make_pair(customFilterProgramProxy->id(), customOperation->validatedProgram()->validatedProgramInfo()));
     272            m_coordinator->state().customFiltersToCreate.append(std::make_pair(customFilterProgramProxy->id(), customOperation->validatedProgram()->validatedProgramInfo()));
    371273        } else {
    372274            // If the client was not disconnected then this coordinator must be the client for it.
     
    381283    // send a message to the other process to delete it.
    382284    m_customFilterPrograms.remove(customFilterProgramProxy);
    383     m_state.customFiltersToRemove.append(customFilterProgramProxy->id());
     285    m_coordinator->state().customFiltersToRemove.append(customFilterProgramProxy->id());
    384286}
    385287
     
    393295#endif // ENABLE(CSS_SHADERS)
    394296
    395 void CoordinatedLayerTreeHost::detachLayer(CoordinatedGraphicsLayer* layer)
    396 {
    397     m_registeredLayers.remove(layer->id());
    398 
    399     size_t index = m_state.layersToCreate.find(layer->id());
    400     if (index != notFound) {
    401         m_state.layersToCreate.remove(index);
    402         return;
    403     }
    404 
    405     m_state.layersToRemove.append(layer->id());
    406     scheduleLayerFlush();
     297void CoordinatedLayerTreeHost::didFlushRootLayer()
     298{
     299    if (m_pageOverlayLayer)
     300        m_pageOverlayLayer->flushCompositingStateForThisLayerOnly();
    407301}
    408302
    409303void CoordinatedLayerTreeHost::performScheduledLayerFlush()
    410304{
    411     if (m_isSuspended || m_waitingForUIProcess)
    412         return;
    413 
    414     syncDisplayState();
     305    if (m_isSuspended || m_isWaitingForRenderer)
     306        return;
     307
     308    m_coordinator->syncDisplayState();
    415309
    416310    if (!m_isValid)
    417311        return;
    418312
    419     if (flushPendingLayerChanges())
    420         didPerformScheduledLayerFlush();
    421 }
    422 
    423 void CoordinatedLayerTreeHost::syncDisplayState()
    424 {
    425 #if ENABLE(INSPECTOR)
    426     m_webPage->corePage()->inspectorController()->didBeginFrame();
    427 #endif
    428 
    429 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) && !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    430     // Make sure that any previously registered animation callbacks are being executed before we flush the layers.
    431     m_lastAnimationServiceTime = WTF::monotonicallyIncreasingTime();
    432     m_webPage->corePage()->mainFrame()->view()->serviceScriptedAnimations(m_lastAnimationServiceTime);
    433 #endif
    434 
    435     m_webPage->layoutIfNeeded();
    436 }
    437 
    438 void CoordinatedLayerTreeHost::didPerformScheduledLayerFlush()
    439 {
    440     if (m_notifyAfterScheduledLayerFlush) {
     313    bool didSync = m_coordinator->flushPendingLayerChanges();
     314
     315    if (m_forceRepaintAsyncCallbackID) {
     316        m_webPage->send(Messages::WebPageProxy::VoidCallback(m_forceRepaintAsyncCallbackID));
     317        m_forceRepaintAsyncCallbackID = 0;
     318    }
     319
     320    if (m_notifyAfterScheduledLayerFlush && didSync) {
    441321        static_cast<DrawingAreaImpl*>(m_webPage->drawingArea())->layerHostDidFlushLayers();
    442322        m_notifyAfterScheduledLayerFlush = false;
     
    453333    ASSERT(!m_pageOverlayLayer);
    454334
    455     m_pageOverlayLayer = GraphicsLayer::create(this, this);
     335    m_pageOverlayLayer = GraphicsLayer::create(graphicsLayerFactory(), m_coordinator.get());
    456336#ifndef NDEBUG
    457     m_pageOverlayLayer->setName("CoordinatedLayerTreeHost page overlay content");
     337    m_pageOverlayLayer->setName("CompositingCoordinator page overlay content");
    458338#endif
    459339
    460340    m_pageOverlayLayer->setDrawsContent(true);
    461     m_pageOverlayLayer->setSize(m_webPage->size());
    462 
    463     m_rootLayer->addChild(m_pageOverlayLayer.get());
     341    m_pageOverlayLayer->setSize(m_coordinator->rootLayer()->size());
     342
     343    m_coordinator->rootLayer()->addChild(m_pageOverlayLayer.get());
    464344}
    465345
     
    471351}
    472352
    473 PassRefPtr<CoordinatedImageBacking> CoordinatedLayerTreeHost::createImageBackingIfNeeded(Image* image)
    474 {
    475     CoordinatedImageBackingID imageID = CoordinatedImageBacking::getCoordinatedImageBackingID(image);
    476     ImageBackingMap::iterator it = m_imageBackings.find(imageID);
    477     RefPtr<CoordinatedImageBacking> imageBacking;
    478     if (it == m_imageBackings.end()) {
    479         imageBacking = CoordinatedImageBacking::create(this, image);
    480         m_imageBackings.add(imageID, imageBacking);
    481     } else
    482         imageBacking = it->value;
    483 
    484     return imageBacking;
    485 }
    486 
    487 void CoordinatedLayerTreeHost::createImageBacking(CoordinatedImageBackingID imageID)
    488 {
    489     m_state.imagesToCreate.append(imageID);
    490 }
    491 
    492 void CoordinatedLayerTreeHost::updateImageBacking(CoordinatedImageBackingID imageID, PassRefPtr<CoordinatedSurface> coordinatedSurface)
    493 {
    494     m_shouldSyncFrame = true;
    495     m_state.imagesToUpdate.append(std::make_pair(imageID, coordinatedSurface));
    496 }
    497 
    498 void CoordinatedLayerTreeHost::clearImageBackingContents(CoordinatedImageBackingID imageID)
    499 {
    500     m_shouldSyncFrame = true;
    501     m_state.imagesToClear.append(imageID);
    502 }
    503 
    504 void CoordinatedLayerTreeHost::removeImageBacking(CoordinatedImageBackingID imageID)
    505 {
    506     if (m_isPurging)
    507         return;
    508 
    509     ASSERT(m_imageBackings.contains(imageID));
    510     m_imageBackings.remove(imageID);
    511 
    512     m_state.imagesToRemove.append(imageID);
    513 }
    514 
    515 void CoordinatedLayerTreeHost::flushPendingImageBackingChanges()
    516 {
    517     ImageBackingMap::iterator end = m_imageBackings.end();
    518     for (ImageBackingMap::iterator iter = m_imageBackings.begin(); iter != end; ++iter)
    519         iter->value->update();
    520 }
    521 
    522 void CoordinatedLayerTreeHost::notifyAnimationStarted(const WebCore::GraphicsLayer*, double /* time */)
    523 {
    524 }
    525 
    526 void CoordinatedLayerTreeHost::notifyFlushRequired(const WebCore::GraphicsLayer*)
    527 {
    528     scheduleLayerFlush();
    529 }
    530 
    531 void CoordinatedLayerTreeHost::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext& graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect)
     353void CoordinatedLayerTreeHost::paintLayerContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, const IntRect& clipRect)
    532354{
    533355    if (graphicsLayer == m_pageOverlayLayer) {
     
    539361}
    540362
    541 PassOwnPtr<GraphicsLayer> CoordinatedLayerTreeHost::createGraphicsLayer(GraphicsLayerClient* client)
    542 {
    543     CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(client);
    544     layer->setCoordinator(this);
    545     m_registeredLayers.add(layer->id(), layer);
    546     m_state.layersToCreate.append(layer->id());
    547     layer->setNeedsVisibleRectAdjustment();
    548     scheduleLayerFlush();
    549     return adoptPtr(layer);
     363void CoordinatedLayerTreeHost::commitSceneState(WebCore::CoordinatedGraphicsState& state)
     364{
     365    m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CommitCoordinatedGraphicsState(state));
     366    m_isWaitingForRenderer = true;
    550367}
    551368
     
    555372}
    556373
    557 float CoordinatedLayerTreeHost::deviceScaleFactor() const
    558 {
    559     return m_webPage->deviceScaleFactor();
    560 }
    561 
    562 float CoordinatedLayerTreeHost::pageScaleFactor() const
    563 {
    564     return m_webPage->pageScaleFactor();
    565 }
    566 
    567374bool LayerTreeHost::supportsAcceleratedCompositing()
    568375{
     
    570377}
    571378
    572 void CoordinatedLayerTreeHost::createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface> coordinatedSurface)
    573 {
    574     m_state.updateAtlasesToCreate.append(std::make_pair(atlasID, coordinatedSurface));
    575 }
    576 
    577 void CoordinatedLayerTreeHost::removeUpdateAtlas(uint32_t atlasID)
    578 {
    579     if (m_isPurging)
    580         return;
    581     m_state.updateAtlasesToRemove.append(atlasID);
    582 }
    583 
    584 WebCore::FloatRect CoordinatedLayerTreeHost::visibleContentsRect() const
    585 {
    586     return m_visibleContentsRect;
    587 }
    588 
    589 CoordinatedGraphicsLayer* CoordinatedLayerTreeHost::mainContentsLayer()
    590 {
    591     if (!m_rootCompositingLayer)
    592         return 0;
    593 
    594     return toCoordinatedGraphicsLayer(m_rootCompositingLayer)->findFirstDescendantWithContentsRecursively();
    595 }
    596 
    597 void CoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect& rect, const FloatPoint& trajectoryVector)
    598 {
    599     // A zero trajectoryVector indicates that tiles all around the viewport are requested.
    600     if (CoordinatedGraphicsLayer* contentsLayer = mainContentsLayer())
    601         contentsLayer->setVisibleContentRectTrajectoryVector(trajectoryVector);
    602 
    603     bool contentsRectDidChange = rect != m_visibleContentsRect;
    604     if (contentsRectDidChange) {
    605         m_visibleContentsRect = rect;
    606 
    607         LayerMap::iterator end = m_registeredLayers.end();
    608         for (LayerMap::iterator it = m_registeredLayers.begin(); it != end; ++it) {
    609             it->value->setNeedsVisibleRectAdjustment();
    610         }
    611     }
    612 
    613     scheduleLayerFlush();
    614     if (m_webPage->useFixedLayout()) {
    615         // Round the rect instead of enclosing it to make sure that its size stays
    616         // the same while panning. This can have nasty effects on layout.
    617         m_webPage->setFixedVisibleContentRect(roundedIntRect(rect));
    618     }
    619 }
    620 
    621379void CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged()
    622380{
    623     m_rootLayer->deviceOrPageScaleFactorChanged();
     381    m_coordinator->deviceOrPageScaleFactorChanged();
    624382    if (m_pageOverlayLayer)
    625383        m_pageOverlayLayer->deviceOrPageScaleFactorChanged();
     
    632390GraphicsLayerFactory* CoordinatedLayerTreeHost::graphicsLayerFactory()
    633391{
    634     return this;
     392    return m_coordinator.get();
    635393}
    636394
     
    638396void CoordinatedLayerTreeHost::scheduleAnimation()
    639397{
    640     if (m_waitingForUIProcess)
     398    if (m_isWaitingForRenderer)
    641399        return;
    642400
     
    644402        return;
    645403
    646     // According to the requestAnimationFrame spec, rAF callbacks should not be faster than 60FPS.
    647     static const double MinimalTimeoutForAnimations = 1. / 60.;
    648     m_layerFlushTimer.startOneShot(std::max<double>(0., MinimalTimeoutForAnimations - WTF::monotonicallyIncreasingTime() + m_lastAnimationServiceTime));
     404    m_layerFlushTimer.startOneShot(m_coordinator->nextAnimationServiceTime());
    649405    scheduleLayerFlush();
    650406}
    651407#endif
    652408
    653 void CoordinatedLayerTreeHost::renderNextFrame()
    654 {
    655     m_waitingForUIProcess = false;
    656     scheduleLayerFlush();
    657     for (unsigned i = 0; i < m_updateAtlases.size(); ++i)
    658         m_updateAtlases[i]->didSwapBuffers();
    659 }
    660 
    661 void CoordinatedLayerTreeHost::purgeBackingStores()
    662 {
    663     TemporaryChange<bool> purgingToggle(m_isPurging, true);
    664 
    665     LayerMap::iterator end = m_registeredLayers.end();
    666     for (LayerMap::iterator it = m_registeredLayers.begin(); it != end; ++it)
    667         it->value->purgeBackingStores();
    668 
    669     m_imageBackings.clear();
    670     m_updateAtlases.clear();
    671 }
    672 
    673 bool CoordinatedLayerTreeHost::paintToSurface(const IntSize& size, CoordinatedSurface::Flags flags, uint32_t& atlasID, IntPoint& offset, CoordinatedSurface::Client* client)
    674 {
    675     for (unsigned i = 0; i < m_updateAtlases.size(); ++i) {
    676         UpdateAtlas* atlas = m_updateAtlases[i].get();
    677         if (atlas->supportsAlpha() == (flags & CoordinatedSurface::SupportsAlpha)) {
    678             // This will false if there is no available buffer space.
    679             if (atlas->paintOnAvailableBuffer(size, atlasID, offset, client))
    680                 return true;
    681         }
    682     }
    683 
    684     static const int ScratchBufferDimension = 1024; // Should be a power of two.
    685     m_updateAtlases.append(adoptPtr(new UpdateAtlas(this, ScratchBufferDimension, flags)));
    686     scheduleReleaseInactiveAtlases();
    687     return m_updateAtlases.last()->paintOnAvailableBuffer(size, atlasID, offset, client);
    688 }
    689 
    690 const double ReleaseInactiveAtlasesTimerInterval = 0.5;
    691 
    692 void CoordinatedLayerTreeHost::scheduleReleaseInactiveAtlases()
    693 {
    694     if (!m_releaseInactiveAtlasesTimer.isActive())
    695         m_releaseInactiveAtlasesTimer.startRepeating(ReleaseInactiveAtlasesTimerInterval);
    696 }
    697 
    698 void CoordinatedLayerTreeHost::releaseInactiveAtlasesTimerFired(Timer<CoordinatedLayerTreeHost>*)
    699 {
    700     // We always want to keep one atlas for non-composited content.
    701     OwnPtr<UpdateAtlas> atlasToKeepAnyway;
    702     bool foundActiveAtlasForNonCompositedContent = false;
    703     for (int i = m_updateAtlases.size() - 1;  i >= 0; --i) {
    704         UpdateAtlas* atlas = m_updateAtlases[i].get();
    705         if (!atlas->isInUse())
    706             atlas->addTimeInactive(ReleaseInactiveAtlasesTimerInterval);
    707         bool usableForNonCompositedContent = !atlas->supportsAlpha();
    708         if (atlas->isInactive()) {
    709             if (!foundActiveAtlasForNonCompositedContent && !atlasToKeepAnyway && usableForNonCompositedContent)
    710                 atlasToKeepAnyway = m_updateAtlases[i].release();
    711             m_updateAtlases.remove(i);
    712         } else if (usableForNonCompositedContent)
    713             foundActiveAtlasForNonCompositedContent = true;
    714     }
    715 
    716     if (!foundActiveAtlasForNonCompositedContent && atlasToKeepAnyway)
    717         m_updateAtlases.append(atlasToKeepAnyway.release());
    718 
    719     if (m_updateAtlases.size() <= 1)
    720         m_releaseInactiveAtlasesTimer.stop();
    721 }
    722 
    723409void CoordinatedLayerTreeHost::setBackgroundColor(const WebCore::Color& color)
    724410{
     
    728414void CoordinatedLayerTreeHost::commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset)
    729415{
    730     LayerMap::iterator i = m_registeredLayers.find(layerID);
    731     if (i == m_registeredLayers.end())
    732         return;
    733 
    734     i->value->commitScrollOffset(offset);
     416    m_coordinator->commitScrollOffset(layerID, offset);
    735417}
    736418
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h

    r152099 r152183  
    2626#include "LayerTreeContext.h"
    2727#include "LayerTreeHost.h"
    28 #include "Timer.h"
    29 #include <WebCore/CoordinatedGraphicsLayer.h>
    30 #include <WebCore/CoordinatedGraphicsState.h>
    31 #include <WebCore/CoordinatedImageBacking.h>
    32 #include <WebCore/GraphicsLayerClient.h>
     28#include <WebCore/CompositingCoordinator.h>
    3329#include <WebCore/GraphicsLayerFactory.h>
    34 #include <WebCore/UpdateAtlas.h>
    3530#include <wtf/OwnPtr.h>
    3631
     
    4742class WebPage;
    4843
    49 class CoordinatedLayerTreeHost : public LayerTreeHost, WebCore::GraphicsLayerClient
    50     , public WebCore::CoordinatedGraphicsLayerClient
    51     , public WebCore::CoordinatedImageBacking::Client
    52     , public WebCore::UpdateAtlas::Client
    53     , public WebCore::GraphicsLayerFactory
     44class CoordinatedLayerTreeHost : public LayerTreeHost, public WebCore::CompositingCoordinator::Client
    5445#if ENABLE(CSS_SHADERS)
    5546    , WebCustomFilterProgramProxyClient
     
    8576    virtual void pageBackgroundTransparencyChanged() OVERRIDE;
    8677
    87     virtual void renderNextFrame();
    88     virtual void purgeBackingStores();
    89     virtual void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint&);
    9078    virtual void didReceiveCoordinatedLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&);
    9179    virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() OVERRIDE;
     
    9987    static PassRefPtr<WebCore::CoordinatedSurface> createCoordinatedSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags);
    10088
    101     void commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset);
    102 
    10389protected:
    10490    explicit CoordinatedLayerTreeHost(WebPage*);
    10591
    10692private:
    107     // GraphicsLayerClient
    108     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
    109     virtual void notifyFlushRequired(const WebCore::GraphicsLayer*);
    110     virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect);
    111     virtual float deviceScaleFactor() const OVERRIDE;
    112     virtual float pageScaleFactor() const OVERRIDE;
    113 
    114     // CoordinatedImageBacking::Client
    115     virtual void createImageBacking(WebCore::CoordinatedImageBackingID) OVERRIDE;
    116     virtual void updateImageBacking(WebCore::CoordinatedImageBackingID, PassRefPtr<WebCore::CoordinatedSurface>) OVERRIDE;
    117     virtual void clearImageBackingContents(WebCore::CoordinatedImageBackingID) OVERRIDE;
    118     virtual void removeImageBacking(WebCore::CoordinatedImageBackingID) OVERRIDE;
    119 
    120     void flushPendingImageBackingChanges();
    121 
    122     // CoordinatedGraphicsLayerClient
    123     virtual bool isFlushingLayerChanges() const OVERRIDE { return m_isFlushingLayerChanges; }
    124     virtual WebCore::FloatRect visibleContentsRect() const;
    125     virtual PassRefPtr<WebCore::CoordinatedImageBacking> createImageBackingIfNeeded(WebCore::Image*) OVERRIDE;
    126     virtual void detachLayer(WebCore::CoordinatedGraphicsLayer*);
    127     virtual bool paintToSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags, uint32_t& /* atlasID */, WebCore::IntPoint&, WebCore::CoordinatedSurface::Client*) OVERRIDE;
    128     virtual void syncLayerState(WebCore::CoordinatedLayerID, WebCore::CoordinatedGraphicsLayerState&);
    129 
    130     // UpdateAtlas::Client
    131     virtual void createUpdateAtlas(uint32_t atlasID, PassRefPtr<WebCore::CoordinatedSurface>) OVERRIDE;
    132     virtual void removeUpdateAtlas(uint32_t atlasID) OVERRIDE;
    133 
    134     // GraphicsLayerFactory
    135     virtual PassOwnPtr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE;
    136 
    13793    // CoordinatedLayerTreeHost
    138     void initializeRootCompositingLayerIfNeeded();
    13994    void createPageOverlayLayer();
    14095    void destroyPageOverlayLayer();
    141     bool flushPendingLayerChanges();
    142     void clearPendingStateChanges();
    14396    void cancelPendingLayerFlush();
    14497    void performScheduledLayerFlush();
    145     void didPerformScheduledLayerFlush();
    146     void syncDisplayState();
     98    void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint&);
     99    void renderNextFrame();
     100    void purgeBackingStores();
     101    void commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset);
     102
    147103    void layerFlushTimerFired(WebCore::Timer<CoordinatedLayerTreeHost>*);
    148104
    149     void scheduleReleaseInactiveAtlases();
    150 
    151     void releaseInactiveAtlasesTimerFired(WebCore::Timer<CoordinatedLayerTreeHost>*);
     105    // CompositingCoordinator::Client
     106    virtual void didFlushRootLayer() OVERRIDE;
     107    virtual void willSyncLayerState(WebCore::CoordinatedGraphicsLayerState&) OVERRIDE;
     108    virtual void notifyFlushRequired() OVERRIDE { scheduleLayerFlush(); };
     109    virtual void commitSceneState(WebCore::CoordinatedGraphicsState&) OVERRIDE;
     110    virtual void paintLayerContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::IntRect& clipRect) OVERRIDE;
    152111
    153112#if ENABLE(CSS_SHADERS)
    154     void prepareCustomFilterProxiesIfNeeded(WebCore::CoordinatedGraphicsLayerState&);
     113    void prepareCustomFilterProxiesForAnimations(WebCore::GraphicsLayerAnimations&);
    155114
    156115    // WebCustomFilterProgramProxyClient
     
    161120#endif
    162121
    163     OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
    164     WebCore::GraphicsLayer* m_rootCompositingLayer;
     122    OwnPtr<WebCore::CompositingCoordinator> m_coordinator;
    165123
    166124    // The page overlay layer. Will be null if there's no page overlay.
    167125    OwnPtr<WebCore::GraphicsLayer> m_pageOverlayLayer;
    168126    RefPtr<PageOverlay> m_pageOverlay;
    169 
    170     WebCore::CoordinatedGraphicsState m_state;
    171 
    172     typedef HashMap<WebCore::CoordinatedLayerID, WebCore::CoordinatedGraphicsLayer*> LayerMap;
    173     LayerMap m_registeredLayers;
    174     typedef HashMap<WebCore::CoordinatedImageBackingID, RefPtr<WebCore::CoordinatedImageBacking> > ImageBackingMap;
    175     ImageBackingMap m_imageBackings;
    176     Vector<OwnPtr<WebCore::UpdateAtlas> > m_updateAtlases;
    177127
    178128#if ENABLE(CSS_SHADERS)
     
    182132    bool m_notifyAfterScheduledLayerFlush;
    183133    bool m_isValid;
    184     // We don't send the messages related to releasing resources to UI Process during purging, because UI Process already had removed all resources.
    185     bool m_isPurging;
    186     bool m_isFlushingLayerChanges;
    187 
    188     bool m_waitingForUIProcess;
    189134    bool m_isSuspended;
    190     WebCore::FloatRect m_visibleContentsRect;
     135    bool m_isWaitingForRenderer;
    191136
    192137    LayerTreeContext m_layerTreeContext;
    193     bool m_shouldSyncFrame;
    194     bool m_didInitializeRootCompositingLayer;
     138
    195139    WebCore::Timer<CoordinatedLayerTreeHost> m_layerFlushTimer;
    196     WebCore::Timer<CoordinatedLayerTreeHost> m_releaseInactiveAtlasesTimer;
    197140    bool m_layerFlushSchedulingEnabled;
    198141    uint64_t m_forceRepaintAsyncCallbackID;
    199     bool m_animationsLocked;
    200 
    201 #if ENABLE(REQUEST_ANIMATION_FRAME)
    202     double m_lastAnimationServiceTime;
    203 #endif
    204142};
    205143
  • trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h

    r152099 r152183  
    8888
    8989#if USE(COORDINATED_GRAPHICS)
    90     virtual void setVisibleContentsRect(const WebCore::FloatRect&, float /* scale */, const WebCore::FloatPoint&) { }
    91     virtual void renderNextFrame() { }
    92     virtual void purgeBackingStores() { }
    9390    virtual void didReceiveCoordinatedLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) = 0;
    9491#endif
Note: See TracChangeset for help on using the changeset viewer.