Changeset 172836 in webkit


Ignore:
Timestamp:
Aug 21, 2014 3:43:18 PM (10 years ago)
Author:
Simon Fraser
Message:

Add animationDidEnd callbacks on GraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=136084

Reviewed by Tim Horton.

Hook up GraphicsLayerClient::notifyAnimationEnded() so that code using GraphicsLayers directly
can add animations, and know when they finish.

Source/WebCore:

  • WebCore.exp.in:
  • platform/graphics/GraphicsLayerClient.h:

(WebCore::GraphicsLayerClient::notifyAnimationStarted):
(WebCore::GraphicsLayerClient::notifyAnimationEnded):

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
(WebCore::GraphicsLayerCA::platformCALayerAnimationEnded):

  • platform/graphics/ca/GraphicsLayerCA.h:
  • platform/graphics/ca/PlatformCALayer.h:
  • platform/graphics/ca/PlatformCALayerClient.h:

(WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
(WebCore::PlatformCALayerClient::platformCALayerAnimationEnded):

  • platform/graphics/ca/mac/PlatformCALayerMac.h:
  • platform/graphics/ca/mac/PlatformCALayerMac.mm:

(-[WebAnimationDelegate animationDidStart:]):
(-[WebAnimationDelegate animationDidStop:finished:]):
(PlatformCALayerMac::animationStarted):
(PlatformCALayerMac::animationEnded):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::notifyAnimationStarted):

  • rendering/RenderLayerBacking.h:

Source/WebKit2:

  • UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
  • UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:

(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):

  • UIProcess/mac/RemoteLayerTreeHost.h:
  • UIProcess/mac/RemoteLayerTreeHost.mm:

(WebKit::RemoteLayerTreeHost::animationDidEnd):

  • WebProcess/WebPage/DrawingArea.h:

(WebKit::DrawingArea::acceleratedAnimationDidEnd):

  • WebProcess/WebPage/DrawingArea.messages.in:
  • WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:

(-[WKAnimationDelegate animationDidStop:finished:]):

  • WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:

(WebKit::PlatformCALayerRemote::animationStarted):
(WebKit::PlatformCALayerRemote::animationEnded):

  • WebProcess/WebPage/mac/PlatformCALayerRemote.h:
  • WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
  • WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:

(WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
(WebKit::RemoteLayerTreeContext::willStartAnimationOnLayer):
(WebKit::RemoteLayerTreeContext::animationDidStart):
(WebKit::RemoteLayerTreeContext::animationDidEnd):

  • WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
  • WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:

(WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidEnd):

Location:
trunk/Source
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r172835 r172836  
     12014-08-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add animationDidEnd callbacks on GraphicsLayer
     4        https://bugs.webkit.org/show_bug.cgi?id=136084
     5
     6        Reviewed by Tim Horton.
     7
     8        Hook up GraphicsLayerClient::notifyAnimationEnded() so that code using GraphicsLayers directly
     9        can add animations, and know when they finish.
     10
     11        * WebCore.exp.in:
     12        * platform/graphics/GraphicsLayerClient.h:
     13        (WebCore::GraphicsLayerClient::notifyAnimationStarted):
     14        (WebCore::GraphicsLayerClient::notifyAnimationEnded):
     15        * platform/graphics/ca/GraphicsLayerCA.cpp:
     16        (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
     17        (WebCore::GraphicsLayerCA::platformCALayerAnimationEnded):
     18        * platform/graphics/ca/GraphicsLayerCA.h:
     19        * platform/graphics/ca/PlatformCALayer.h:
     20        * platform/graphics/ca/PlatformCALayerClient.h:
     21        (WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
     22        (WebCore::PlatformCALayerClient::platformCALayerAnimationEnded):
     23        * platform/graphics/ca/mac/PlatformCALayerMac.h:
     24        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
     25        (-[WebAnimationDelegate animationDidStart:]):
     26        (-[WebAnimationDelegate animationDidStop:finished:]):
     27        (PlatformCALayerMac::animationStarted):
     28        (PlatformCALayerMac::animationEnded):
     29        * rendering/RenderLayerBacking.cpp:
     30        (WebCore::RenderLayerBacking::notifyAnimationStarted):
     31        * rendering/RenderLayerBacking.h:
     32
    1332014-08-21  Zalan Bujtas  <zalan@apple.com>
    234
  • trunk/Source/WebCore/WebCore.exp.in

    r172826 r172836  
    598598__ZN7WebCore15GraphicsLayerCA23setDebugBackgroundColorERKNS_5ColorE
    599599__ZN7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_9FloatRectE
     600__ZN7WebCore15GraphicsLayerCA29platformCALayerAnimationEndedERKN3WTF6StringE
    600601__ZN7WebCore15GraphicsLayerCA30deviceOrPageScaleFactorChangedEv
    601 __ZN7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedEd
     602__ZN7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedERKN3WTF6StringEd
    602603__ZN7WebCore15GraphicsLayerCA37flushCompositingStateForThisLayerOnlyEv
    603604__ZN7WebCore15GraphicsLayerCA40platformCALayerSetNeedsToRevalidateTilesEv
     
    20592060__ZTVN7WebCore31BasicColorMatrixFilterOperationE
    20602061__ZTVN7WebCore37BasicComponentTransferFilterOperationE
     2062__ZThn504_N7WebCore15GraphicsLayerCA29platformCALayerAnimationEndedERKN3WTF6StringE
     2063__ZThn504_N7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedERKN3WTF6StringEd
    20612064__ZThn???_N7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_9FloatRectE
    20622065__ZThn???_N7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedEd
  • trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h

    r172738 r172836  
    6363   
    6464    // Callback for when hardware-accelerated animation started.
    65     virtual void notifyAnimationStarted(const GraphicsLayer*, double /*time*/) { }
     65    virtual void notifyAnimationStarted(const GraphicsLayer*, const String& /*animationKey*/, double /*time*/) { }
     66    virtual void notifyAnimationEnded(const GraphicsLayer*, const String& /*animationKey*/) { }
    6667
    6768    // Notification that a layer property changed that requires a subsequent call to flushCompositingState()
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r172681 r172836  
    844844}
    845845
    846 void GraphicsLayerCA::platformCALayerAnimationStarted(CFTimeInterval startTime)
    847 {
    848     client().notifyAnimationStarted(this, startTime);
     846void GraphicsLayerCA::platformCALayerAnimationStarted(const String& animationKey, CFTimeInterval startTime)
     847{
     848    client().notifyAnimationStarted(this, animationKey, startTime);
     849}
     850
     851void GraphicsLayerCA::platformCALayerAnimationEnded(const String& animationKey)
     852{
     853    client().notifyAnimationEnded(this, animationKey);
    849854}
    850855
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r172831 r172836  
    180180    virtual bool platformCALayerRespondsToLayoutChanges() const override { return false; }
    181181
    182     WEBCORE_EXPORT virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) override;
     182    WEBCORE_EXPORT void platformCALayerAnimationStarted(const String& animationKey, CFTimeInterval beginTime) override;
     183    WEBCORE_EXPORT void platformCALayerAnimationEnded(const String& animationKey) override;
    183184    virtual CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return contentsOrientation(); }
    184185    WEBCORE_EXPORT virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& clip) override;
  • trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h

    r172831 r172836  
    103103
    104104    virtual void animationStarted(const String& key, CFTimeInterval beginTime) = 0;
     105    virtual void animationEnded(const String& key) = 0;
    105106
    106107    virtual void setNeedsDisplay() = 0;
  • trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h

    r170071 r172836  
    4040    virtual bool platformCALayerRespondsToLayoutChanges() const { return false; }
    4141
    42     virtual void platformCALayerAnimationStarted(CFTimeInterval) { }
     42    virtual void platformCALayerAnimationStarted(const String& /*animationKey*/, CFTimeInterval) { }
     43    virtual void platformCALayerAnimationEnded(const String& /*animationKey*/) { }
    4344    virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesTopDown; }
    4445    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& inClip) = 0;
  • trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h

    r172831 r172836  
    6666    virtual PassRefPtr<PlatformCAAnimation> animationForKey(const String& key) override;
    6767    virtual void animationStarted(const String& key, CFTimeInterval beginTime) override;
     68    virtual void animationEnded(const String& key) override;
    6869
    6970    virtual void setMask(PlatformCALayer*) override;
  • trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm

    r172681 r172836  
    115115    WebThreadLock();
    116116#endif
     117    if (!m_owner)
     118        return;
     119
    117120    CFTimeInterval startTime;
    118121    if (hasExplicitBeginTime(animation)) {
     
    123126        startTime = mediaTimeToCurrentTime([animation beginTime]);
    124127
    125     if (m_owner) {
    126         CALayer *layer = m_owner->platformLayer();
    127 
    128         String animationKey;
    129         for (NSString *key in [layer animationKeys]) {
    130             if ([layer animationForKey:key] == animation) {
    131                 animationKey = key;
    132                 break;
    133             }
     128    CALayer *layer = m_owner->platformLayer();
     129
     130    String animationKey;
     131    for (NSString *key in [layer animationKeys]) {
     132        if ([layer animationForKey:key] == animation) {
     133            animationKey = key;
     134            break;
    134135        }
    135 
    136         if (!animationKey.isEmpty())
    137             m_owner->animationStarted(animationKey, startTime);
    138     }
     136    }
     137
     138    if (!animationKey.isEmpty())
     139        m_owner->animationStarted(animationKey, startTime);
     140}
     141
     142- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)finished
     143{
     144#if PLATFORM(IOS)
     145    WebThreadLock();
     146#endif
     147    UNUSED_PARAM(finished);
     148
     149    if (!m_owner)
     150        return;
     151   
     152    CALayer *layer = m_owner->platformLayer();
     153
     154    String animationKey;
     155    for (NSString *key in [layer animationKeys]) {
     156        if ([layer animationForKey:key] == animation) {
     157            animationKey = key;
     158            break;
     159        }
     160    }
     161
     162    if (!animationKey.isEmpty())
     163        m_owner->animationEnded(animationKey);
    139164}
    140165
     
    326351}
    327352
    328 void PlatformCALayerMac::animationStarted(const String&, CFTimeInterval beginTime)
     353void PlatformCALayerMac::animationStarted(const String& animationKey, CFTimeInterval beginTime)
    329354{
    330355    if (m_owner)
    331         m_owner->platformCALayerAnimationStarted(beginTime);
     356        m_owner->platformCALayerAnimationStarted(animationKey, beginTime);
     357}
     358
     359void PlatformCALayerMac::animationEnded(const String& animationKey)
     360{
     361    if (m_owner)
     362        m_owner->platformCALayerAnimationEnded(animationKey);
    332363}
    333364
  • trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp

    r172681 r172836  
    196196}
    197197
    198 void PlatformCALayerWin::animationStarted(const String&, CFTimeInterval beginTime)
     198void PlatformCALayerWin::animationStarted(const String& animationKey, CFTimeInterval beginTime)
    199199{
    200200    // Update start time for any animation not yet started
     
    206206
    207207    if (m_owner)
    208         m_owner->platformCALayerAnimationStarted(beginTime);
     208        m_owner->platformCALayerAnimationStarted(animationKey, beginTime);
     209}
     210
     211void PlatformCALayerWin::animationEnded(const String& animationKey)
     212{
     213    if (m_owner)
     214        m_owner->platformCALayerAnimationEnded(animationKey);
    209215}
    210216
  • trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h

    r172681 r172836  
    5757    virtual PassRefPtr<PlatformCAAnimation> animationForKey(const String& key) override;
    5858    virtual void animationStarted(const String& key, CFTimeInterval beginTime) override;
     59    virtual void animationEnded(const String& key) override;
    5960
    6061    virtual void setMask(PlatformCALayer*) override;
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp

    r171725 r172836  
    559559
    560560    if (m_changeMask & AnimationStarted)
    561         client().notifyAnimationStarted(this, m_animationStartTime);
     561        client().notifyAnimationStarted(this, "", m_animationStartTime);
    562562
    563563    if (m_changeMask & FixedToViewporChange)
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp

    r170813 r172836  
    240240}
    241241
    242 void CompositingCoordinator::notifyAnimationStarted(const GraphicsLayer*, double /* time */)
     242void CompositingCoordinator::notifyAnimationStarted(const GraphicsLayer*, const String&, double /* time */)
    243243{
    244244}
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h

    r168423 r172836  
    9090private:
    9191    // GraphicsLayerClient
    92     virtual void notifyAnimationStarted(const GraphicsLayer*, double time) override;
     92    virtual void notifyAnimationStarted(const GraphicsLayer*, const String&, double time) override;
    9393    virtual void notifyFlushRequired(const GraphicsLayer*) override;
    9494    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clipRect) override;
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

    r170774 r172836  
    12271227void CoordinatedGraphicsLayer::animationStartedTimerFired(Timer<CoordinatedGraphicsLayer>*)
    12281228{
    1229     client().notifyAnimationStarted(this, m_lastAnimationStartTime);
     1229    client().notifyAnimationStarted(this, "", m_lastAnimationStartTime);
    12301230}
    12311231} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r171494 r172836  
    24612461}
    24622462
    2463 void RenderLayerBacking::notifyAnimationStarted(const GraphicsLayer*, double time)
     2463void RenderLayerBacking::notifyAnimationStarted(const GraphicsLayer*, const String&, double time)
    24642464{
    24652465    renderer().animation().notifyAnimationStarted(&renderer(), time);
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r170203 r172836  
    195195    virtual bool shouldUseTiledBacking(const GraphicsLayer*) const override;
    196196    virtual void tiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/) override;
    197     virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime) override;
     197    virtual void notifyAnimationStarted(const GraphicsLayer*, const String& animationKey, double startTime) override;
    198198    virtual void notifyFlushRequired(const GraphicsLayer*) override;
    199199    virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override;
  • trunk/Source/WebKit2/ChangeLog

    r172835 r172836  
     12014-08-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add animationDidEnd callbacks on GraphicsLayer
     4        https://bugs.webkit.org/show_bug.cgi?id=136084
     5
     6        Reviewed by Tim Horton.
     7
     8        Hook up GraphicsLayerClient::notifyAnimationEnded() so that code using GraphicsLayers directly
     9        can add animations, and know when they finish.
     10
     11        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
     12        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
     13        (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
     14        * UIProcess/mac/RemoteLayerTreeHost.h:
     15        * UIProcess/mac/RemoteLayerTreeHost.mm:
     16        (WebKit::RemoteLayerTreeHost::animationDidEnd):
     17        * WebProcess/WebPage/DrawingArea.h:
     18        (WebKit::DrawingArea::acceleratedAnimationDidEnd):
     19        * WebProcess/WebPage/DrawingArea.messages.in:
     20        * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
     21        (-[WKAnimationDelegate animationDidStop:finished:]):
     22        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
     23        (WebKit::PlatformCALayerRemote::animationStarted):
     24        (WebKit::PlatformCALayerRemote::animationEnded):
     25        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
     26        * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
     27        * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
     28        (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
     29        (WebKit::RemoteLayerTreeContext::willStartAnimationOnLayer):
     30        (WebKit::RemoteLayerTreeContext::animationDidStart):
     31        (WebKit::RemoteLayerTreeContext::animationDidEnd):
     32        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
     33        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
     34        (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidEnd):
     35
    1362014-08-21  Zalan Bujtas  <zalan@apple.com>
    237
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h

    r171191 r172836  
    4848
    4949    void acceleratedAnimationDidStart(uint64_t layerID, const String& key, double startTime);
     50    void acceleratedAnimationDidEnd(uint64_t layerID, const String& key);
    5051
    5152    uint64_t nextLayerTreeTransactionID() const { return m_pendingLayerTreeTransactionID + 1; }
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm

    r171560 r172836  
    242242}
    243243
     244void RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd(uint64_t layerID, const String& key)
     245{
     246    m_webPageProxy->process().send(Messages::DrawingArea::AcceleratedAnimationDidEnd(layerID, key), m_webPageProxy->pageID());
     247}
     248
    244249static const float indicatorInset = 10;
    245250
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h

    r171191 r172836  
    6161
    6262    void animationDidStart(WebCore::GraphicsLayer::PlatformLayerID, CAAnimation *, double startTime);
     63    void animationDidEnd(WebCore::GraphicsLayer::PlatformLayerID, CAAnimation *);
    6364
    6465    void clearLayers();
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm

    r171191 r172836  
    153153}
    154154
     155void RemoteLayerTreeHost::animationDidEnd(WebCore::GraphicsLayer::PlatformLayerID layerID, CAAnimation *animation)
     156{
     157    CALayer *layer = asLayer(getLayer(layerID));
     158    if (!layer)
     159        return;
     160
     161    String animationKey;
     162    for (NSString *key in [layer animationKeys]) {
     163        if ([layer animationForKey:key] == animation) {
     164            animationKey = key;
     165            break;
     166        }
     167    }
     168
     169    if (!animationKey.isEmpty())
     170        m_drawingArea.acceleratedAnimationDidEnd(layerID, animationKey);
     171
     172}
     173
    155174void RemoteLayerTreeHost::clearLayers()
    156175{
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h

    r172104 r172836  
    8989    virtual WebCore::FloatRect exposedRect() const = 0;
    9090    virtual void acceleratedAnimationDidStart(uint64_t /*layerID*/, const String& /*key*/, double /*startTime*/) { }
     91    virtual void acceleratedAnimationDidEnd(uint64_t /*layerID*/, const String& /*key*/) { }
    9192#endif
    9293#if PLATFORM(IOS)
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in

    r170761 r172836  
    3636   
    3737    AcceleratedAnimationDidStart(uint64_t layerID, String key, double startTime)
     38    AcceleratedAnimationDidEnd(uint64_t layerID, String key)
    3839   
    3940    AddTransactionCallbackID(uint64_t callbackID)
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm

    r170774 r172836  
    8282    _layerTreeHost->animationDidStart(_layerID, animation, startTime);
    8383}
     84
     85- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)finished
     86{
     87    _layerTreeHost->animationDidEnd(_layerID, animation);
     88}
     89
    8490@end
    8591
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

    r172681 r172836  
    370370   
    371371    if (m_owner)
    372         m_owner->platformCALayerAnimationStarted(beginTime);
     372        m_owner->platformCALayerAnimationStarted(key, beginTime);
     373}
     374
     375void PlatformCALayerRemote::animationEnded(const String& key)
     376{
     377    if (m_owner)
     378        m_owner->platformCALayerAnimationEnded(key);
    373379}
    374380
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h

    r172681 r172836  
    7171    virtual PassRefPtr<WebCore::PlatformCAAnimation> animationForKey(const String& key) override;
    7272    virtual void animationStarted(const String& key, CFTimeInterval beginTime) override;
     73    virtual void animationEnded(const String& key) override;
    7374
    7475    virtual void setMask(WebCore::PlatformCALayer*) override;
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h

    r170274 r172836  
    6464    // From the UI process
    6565    void animationDidStart(WebCore::GraphicsLayer::PlatformLayerID, const String& key, double startTime);
     66    void animationDidEnd(WebCore::GraphicsLayer::PlatformLayerID, const String& key);
    6667
    6768    void willStartAnimationOnLayer(PlatformCALayerRemote&);
     
    7980
    8081    HashMap<WebCore::GraphicsLayer::PlatformLayerID, PlatformCALayerRemote*> m_liveLayers;
    81     HashMap<WebCore::GraphicsLayer::PlatformLayerID, PlatformCALayerRemote*> m_layersAwaitingAnimationStart;
     82    HashMap<WebCore::GraphicsLayer::PlatformLayerID, PlatformCALayerRemote*> m_layersWithAnimations;
    8283
    8384    RemoteLayerBackingStoreCollection m_backingStoreCollection;
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm

    r170864 r172836  
    7979    m_destroyedLayers.append(layerID);
    8080   
    81     m_layersAwaitingAnimationStart.remove(layerID);
     81    m_layersWithAnimations.remove(layerID);
    8282}
    8383
     
    123123void RemoteLayerTreeContext::willStartAnimationOnLayer(PlatformCALayerRemote& layer)
    124124{
    125     m_layersAwaitingAnimationStart.add(layer.layerID(), &layer);
     125    m_layersWithAnimations.add(layer.layerID(), &layer);
    126126}
    127127
    128128void RemoteLayerTreeContext::animationDidStart(WebCore::GraphicsLayer::PlatformLayerID layerID, const String& key, double startTime)
    129129{
    130     auto it = m_layersAwaitingAnimationStart.find(layerID);
    131     if (it != m_layersAwaitingAnimationStart.end())
     130    auto it = m_layersWithAnimations.find(layerID);
     131    if (it != m_layersWithAnimations.end())
    132132        it->value->animationStarted(key, startTime);
    133133}
    134134
     135void RemoteLayerTreeContext::animationDidEnd(WebCore::GraphicsLayer::PlatformLayerID layerID, const String& key)
     136{
     137    auto it = m_layersWithAnimations.find(layerID);
     138    if (it != m_layersWithAnimations.end())
     139        it->value->animationEnded(key);
     140}
     141
    135142} // namespace WebKit
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h

    r172738 r172836  
    8989
    9090    virtual void acceleratedAnimationDidStart(uint64_t layerID, const String& key, double startTime) override;
     91    virtual void acceleratedAnimationDidEnd(uint64_t layerID, const String& key) override;
    9192
    9293#if PLATFORM(IOS)
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm

    r171336 r172836  
    194194}
    195195
     196void RemoteLayerTreeDrawingArea::acceleratedAnimationDidEnd(uint64_t layerID, const String& key)
     197{
     198    m_remoteLayerTreeContext->animationDidEnd(layerID, key);
     199}
     200
    196201void RemoteLayerTreeDrawingArea::setExposedRect(const FloatRect& exposedRect)
    197202{
Note: See TracChangeset for help on using the changeset viewer.