Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: Source/core/animation/AnimationPlayer.h

Issue 946323002: Animations: Introduce compositor AnimationPlayer and AnimationTimeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Format. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/animation/Animation.cpp ('k') | Source/core/animation/AnimationPlayer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationPlayer.h
diff --git a/Source/core/animation/AnimationPlayer.h b/Source/core/animation/AnimationPlayer.h
index d9e23f50270e37e2b3f36e6c7d86b064221e7f71..81b6443058938a8c84a2aa8344d0aead2602ecd0 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 ActiveDOMObject
+ , public WebCompositorAnimationDelegate
+ , public WebCompositorAnimationPlayerClient {
DEFINE_WRAPPERTYPEINFO();
REFCOUNTED_EVENT_TARGET(AnimationPlayer);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AnimationPlayer);
@@ -140,7 +145,8 @@ public:
void setOutdated();
bool outdated() { return m_outdated; }
- bool canStartAnimationOnCompositor();
+ bool canStartAnimationOnCompositor() const;
+ bool isCandidateForAnimationOnCompositor() const;
bool maybeStartAnimationOnCompositor();
void cancelAnimationOnCompositor();
void restartAnimationOnCompositor();
@@ -149,6 +155,8 @@ public:
void setCompositorPending(bool sourceChanged = false);
void notifyCompositorStartTime(double timelineTime);
void notifyStartTime(double timelineTime);
+ // WebCompositorAnimationPlayerClient implementation.
+ WebCompositorAnimationPlayer* compositorPlayer() const override { return m_compositorPlayer.get(); }
bool affects(const Element&, CSSPropertyID) const;
@@ -183,6 +191,16 @@ private:
void beginUpdatingState();
void endUpdatingState();
+ void createCompositorPlayer();
+ void destroyCompositorPlayer();
+ void attachCompositorTimeline();
+ void detachCompositorTimeline();
+ void attachCompositedLayers();
+ void detachCompositedLayers();
+ // 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 +276,10 @@ private:
bool m_compositorPending;
int m_compositorGroup;
+ OwnPtr<WebCompositorAnimationPlayer> m_compositorPlayer;
+
bool m_currentTimePending;
bool m_stateIsBeingUpdated;
-
};
} // namespace blink
« no previous file with comments | « Source/core/animation/Animation.cpp ('k') | Source/core/animation/AnimationPlayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698