Chromium Code Reviews| Index: Source/core/animation/AnimationPlayer.h |
| diff --git a/Source/core/animation/AnimationPlayer.h b/Source/core/animation/AnimationPlayer.h |
| index ea016e22c22c1440b19f96c7720500de6f9c8714..cfd2415888ab33329732e1fa639c53570e1db16e 100644 |
| --- a/Source/core/animation/AnimationPlayer.h |
| +++ b/Source/core/animation/AnimationPlayer.h |
| @@ -39,6 +39,8 @@ |
| #include "core/dom/DOMException.h" |
| #include "core/events/EventTarget.h" |
| #include "platform/heap/Handle.h" |
| +#include "public/platform/WebCompositorAnimationDelegate.h" |
| +#include "public/platform/WebCompositorAnimationPlayerClient.h" |
| #include "wtf/RefPtr.h" |
| namespace blink { |
| @@ -46,11 +48,14 @@ namespace blink { |
| class AnimationTimeline; |
| class Element; |
| class ExceptionState; |
| +class WebCompositorAnimationPlayer; |
| class AnimationPlayer final |
| - : public EventTargetWithInlineData |
| - , public RefCountedWillBeNoBase<AnimationPlayer> |
| - , public ActiveDOMObject { |
| + : public EventTargetWithInlineData, |
| + public RefCountedWillBeNoBase<AnimationPlayer>, |
| + public ActiveDOMObject, |
| + public WebCompositorAnimationDelegate, |
| + public WebCompositorAnimationPlayerClient { |
| DEFINE_WRAPPERTYPEINFO(); |
| REFCOUNTED_EVENT_TARGET(AnimationPlayer); |
| WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AnimationPlayer); |
| @@ -149,6 +154,10 @@ public: |
| void setCompositorPending(bool sourceChanged = false); |
| void notifyCompositorStartTime(double timelineTime); |
| void notifyStartTime(double timelineTime); |
| + // WebCompositorAnimationPlayerClient implementation. |
| + WebCompositorAnimationPlayer* compositorPlayer() const override { return m_compositorPlayer.get(); } |
| + |
| + void updateCompositorPlayerToElementAttachment(); |
| bool affects(const Element&, CSSPropertyID) const; |
| @@ -183,6 +192,14 @@ private: |
| void beginUpdatingState(); |
| void endUpdatingState(); |
| + void createCompositorPlayer(); |
| + void destroyCompositorPlayer(); |
| + void attachElementToPlayer(); |
| + void detachElementFromPlayer(); |
| + // WebCompositorAnimationDelegate implementation. |
| + void notifyAnimationStarted(double monotonicTime, int group) override; |
| + void notifyAnimationFinished(double monotonicTime, int group) override { } |
| + |
| AnimationPlayState m_playState; |
| double m_playbackRate; |
| double m_startTime; |
| @@ -258,9 +275,11 @@ private: |
| bool m_compositorPending; |
| int m_compositorGroup; |
| + OwnPtr<WebCompositorAnimationPlayer> m_compositorPlayer; |
| + bool m_attachCompositorPlayerToElement; |
|
dstockwell
2015/03/22 23:07:28
Couldn't we tie this attachment to the lifetime of
|
| + |
| bool m_currentTimePending; |
| bool m_stateIsBeingUpdated; |
| - |
| }; |
| } // namespace blink |