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

Unified Diff: third_party/WebKit/Source/platform/animation/CompositorAnimation.h

Issue 1616653002: CC Animation: Move files from cc_blink to Source/platform/animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Fix copyrights and years. Created 4 years, 10 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
Index: third_party/WebKit/Source/platform/animation/CompositorAnimation.h
diff --git a/third_party/WebKit/Source/platform/animation/CompositorAnimation.h b/third_party/WebKit/Source/platform/animation/CompositorAnimation.h
new file mode 100644
index 0000000000000000000000000000000000000000..80211b62a9c8c3fae32310cfd6685bd4ccf4495b
--- /dev/null
+++ b/third_party/WebKit/Source/platform/animation/CompositorAnimation.h
@@ -0,0 +1,93 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CompositorAnimation_h
+#define CompositorAnimation_h
+
+#include "base/memory/scoped_ptr.h"
+#include "platform/PlatformExport.h"
+#include "wtf/Noncopyable.h"
+
+namespace cc {
+class Animation;
+}
+
+namespace blink {
+
+class CompositorAnimationCurve;
+
+// A compositor driven animation.
+class PLATFORM_EXPORT CompositorAnimation {
+ WTF_MAKE_NONCOPYABLE(CompositorAnimation);
+public:
+ enum TargetProperty {
+ TargetPropertyTransform,
+ TargetPropertyOpacity,
+ TargetPropertyFilter,
+ TargetPropertyScrollOffset
+ };
+
+ enum Direction {
+ DirectionNormal,
+ DirectionReverse,
+ DirectionAlternate,
+ DirectionAlternateReverse
+ };
+
+ enum FillMode {
+ FillModeNone,
+ FillModeForwards,
+ FillModeBackwards,
+ FillModeBoth
+ };
+
+ CompositorAnimation(const CompositorAnimationCurve&, TargetProperty, int animationId, int groupId);
+ virtual ~CompositorAnimation();
+
+ // An id must be unique.
+ virtual int id();
+ virtual int group();
+
+ virtual TargetProperty targetProperty() const;
+
+ // This is the number of times that the animation will play. If this
+ // value is zero the animation will not play. If it is negative, then
+ // the animation will loop indefinitely.
+ virtual double iterations() const;
+ virtual void setIterations(double);
+
+ virtual double startTime() const;
+ virtual void setStartTime(double monotonicTime);
+
+ virtual double timeOffset() const;
+ virtual void setTimeOffset(double monotonicTime);
+
+ virtual Direction direction() const;
+ virtual void setDirection(Direction);
+
+ virtual double playbackRate() const;
+ virtual void setPlaybackRate(double);
+
+ virtual FillMode fillMode() const;
+ virtual void setFillMode(FillMode);
+
+ virtual double iterationStart() const;
+ virtual void setIterationStart(double);
+
+ scoped_ptr<cc::Animation> passAnimation();
+
+ // Removes ownership over cc animation. Identical to PassAnimation.
+ // TODO(loyso): Erase this method. crbug.com/575041
+ cc::Animation* releaseCCAnimation();
+
+protected:
+ CompositorAnimation();
+
+private:
+ scoped_ptr<cc::Animation> m_animation;
+};
+
+} // namespace blink
+
+#endif // CompositorAnimation_h

Powered by Google App Engine
This is Rietveld 408576698