OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CompositorAnimation_h | 5 #ifndef CompositorAnimation_h |
6 #define CompositorAnimation_h | 6 #define CompositorAnimation_h |
7 | 7 |
8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
10 #include "platform/animation/CompositorTargetProperty.h" | 10 #include "platform/animation/CompositorTargetProperty.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class CompositorAnimationCurve; | 21 class CompositorAnimationCurve; |
22 | 22 |
23 // A compositor driven animation. | 23 // A compositor driven animation. |
24 class PLATFORM_EXPORT CompositorAnimation { | 24 class PLATFORM_EXPORT CompositorAnimation { |
25 WTF_MAKE_NONCOPYABLE(CompositorAnimation); | 25 WTF_MAKE_NONCOPYABLE(CompositorAnimation); |
26 public: | 26 public: |
27 using Direction = cc::Animation::Direction; | 27 using Direction = cc::Animation::Direction; |
28 using FillMode = cc::Animation::FillMode; | 28 using FillMode = cc::Animation::FillMode; |
29 | 29 |
30 CompositorAnimation(const CompositorAnimationCurve&, CompositorTargetPropert
y::Type, int animationId, int groupId); | 30 CompositorAnimation(const CompositorAnimationCurve&, CompositorTargetPropert
y::Type, int animationId, int groupId); |
31 virtual ~CompositorAnimation(); | 31 ~CompositorAnimation(); |
32 | 32 |
33 // An id must be unique. | 33 // An id must be unique. |
34 virtual int id(); | 34 int id() const; |
35 virtual int group(); | 35 int group() const; |
36 | 36 |
37 virtual CompositorTargetProperty::Type targetProperty() const; | 37 CompositorTargetProperty::Type targetProperty() const; |
38 | 38 |
39 // This is the number of times that the animation will play. If this | 39 // This is the number of times that the animation will play. If this |
40 // value is zero the animation will not play. If it is negative, then | 40 // value is zero the animation will not play. If it is negative, then |
41 // the animation will loop indefinitely. | 41 // the animation will loop indefinitely. |
42 virtual double iterations() const; | 42 double iterations() const; |
43 virtual void setIterations(double); | 43 void setIterations(double); |
44 | 44 |
45 virtual double startTime() const; | 45 double startTime() const; |
46 virtual void setStartTime(double monotonicTime); | 46 void setStartTime(double monotonicTime); |
47 | 47 |
48 virtual double timeOffset() const; | 48 double timeOffset() const; |
49 virtual void setTimeOffset(double monotonicTime); | 49 void setTimeOffset(double monotonicTime); |
50 | 50 |
51 virtual Direction getDirection() const; | 51 Direction getDirection() const; |
52 virtual void setDirection(Direction); | 52 void setDirection(Direction); |
53 | 53 |
54 virtual double playbackRate() const; | 54 double playbackRate() const; |
55 virtual void setPlaybackRate(double); | 55 void setPlaybackRate(double); |
56 | 56 |
57 virtual FillMode getFillMode() const; | 57 FillMode getFillMode() const; |
58 virtual void setFillMode(FillMode); | 58 void setFillMode(FillMode); |
59 | 59 |
60 virtual double iterationStart() const; | 60 double iterationStart() const; |
61 virtual void setIterationStart(double); | 61 void setIterationStart(double); |
62 | 62 |
63 std::unique_ptr<cc::Animation> passAnimation(); | 63 std::unique_ptr<cc::Animation> passAnimation(); |
64 | 64 |
65 protected: | |
66 CompositorAnimation(); | |
67 | |
68 private: | 65 private: |
69 std::unique_ptr<cc::Animation> m_animation; | 66 std::unique_ptr<cc::Animation> m_animation; |
70 }; | 67 }; |
71 | 68 |
72 } // namespace blink | 69 } // namespace blink |
73 | 70 |
74 #endif // CompositorAnimation_h | 71 #endif // CompositorAnimation_h |
OLD | NEW |