| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 10 #include "platform/animation/CompositorTargetProperty.h" |
| 10 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
| 11 | 12 |
| 12 namespace cc { | 13 namespace cc { |
| 13 class Animation; | 14 class Animation; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 class CompositorAnimationCurve; | 19 class CompositorAnimationCurve; |
| 19 | 20 |
| 20 // A compositor driven animation. | 21 // A compositor driven animation. |
| 21 class PLATFORM_EXPORT CompositorAnimation { | 22 class PLATFORM_EXPORT CompositorAnimation { |
| 22 WTF_MAKE_NONCOPYABLE(CompositorAnimation); | 23 WTF_MAKE_NONCOPYABLE(CompositorAnimation); |
| 23 public: | 24 public: |
| 24 enum TargetProperty { | |
| 25 TargetPropertyTransform, | |
| 26 TargetPropertyOpacity, | |
| 27 TargetPropertyFilter, | |
| 28 TargetPropertyScrollOffset | |
| 29 }; | |
| 30 | |
| 31 enum Direction { | 25 enum Direction { |
| 32 DirectionNormal, | 26 DirectionNormal, |
| 33 DirectionReverse, | 27 DirectionReverse, |
| 34 DirectionAlternate, | 28 DirectionAlternate, |
| 35 DirectionAlternateReverse | 29 DirectionAlternateReverse |
| 36 }; | 30 }; |
| 37 | 31 |
| 38 enum FillMode { | 32 enum FillMode { |
| 39 FillModeNone, | 33 FillModeNone, |
| 40 FillModeForwards, | 34 FillModeForwards, |
| 41 FillModeBackwards, | 35 FillModeBackwards, |
| 42 FillModeBoth | 36 FillModeBoth |
| 43 }; | 37 }; |
| 44 | 38 |
| 45 CompositorAnimation(const CompositorAnimationCurve&, TargetProperty, int ani
mationId, int groupId); | 39 CompositorAnimation(const CompositorAnimationCurve&, CompositorTargetPropert
y::Type, int animationId, int groupId); |
| 46 virtual ~CompositorAnimation(); | 40 virtual ~CompositorAnimation(); |
| 47 | 41 |
| 48 // An id must be unique. | 42 // An id must be unique. |
| 49 virtual int id(); | 43 virtual int id(); |
| 50 virtual int group(); | 44 virtual int group(); |
| 51 | 45 |
| 52 virtual TargetProperty targetProperty() const; | 46 virtual CompositorTargetProperty::Type targetProperty() const; |
| 53 | 47 |
| 54 // This is the number of times that the animation will play. If this | 48 // This is the number of times that the animation will play. If this |
| 55 // value is zero the animation will not play. If it is negative, then | 49 // value is zero the animation will not play. If it is negative, then |
| 56 // the animation will loop indefinitely. | 50 // the animation will loop indefinitely. |
| 57 virtual double iterations() const; | 51 virtual double iterations() const; |
| 58 virtual void setIterations(double); | 52 virtual void setIterations(double); |
| 59 | 53 |
| 60 virtual double startTime() const; | 54 virtual double startTime() const; |
| 61 virtual void setStartTime(double monotonicTime); | 55 virtual void setStartTime(double monotonicTime); |
| 62 | 56 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 84 protected: | 78 protected: |
| 85 CompositorAnimation(); | 79 CompositorAnimation(); |
| 86 | 80 |
| 87 private: | 81 private: |
| 88 scoped_ptr<cc::Animation> m_animation; | 82 scoped_ptr<cc::Animation> m_animation; |
| 89 }; | 83 }; |
| 90 | 84 |
| 91 } // namespace blink | 85 } // namespace blink |
| 92 | 86 |
| 93 #endif // CompositorAnimation_h | 87 #endif // CompositorAnimation_h |
| OLD | NEW |