OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CompositorAnimation_h |
| 6 #define CompositorAnimation_h |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "platform/PlatformExport.h" |
| 10 |
| 11 namespace cc { |
| 12 class Animation; |
| 13 } |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 class CompositorAnimationCurve; |
| 18 |
| 19 // A compositor driven animation. |
| 20 class PLATFORM_EXPORT CompositorAnimation { |
| 21 public: |
| 22 enum TargetProperty { |
| 23 TargetPropertyTransform, |
| 24 TargetPropertyOpacity, |
| 25 TargetPropertyFilter, |
| 26 TargetPropertyScrollOffset |
| 27 }; |
| 28 |
| 29 enum Direction { |
| 30 DirectionNormal, |
| 31 DirectionReverse, |
| 32 DirectionAlternate, |
| 33 DirectionAlternateReverse |
| 34 }; |
| 35 |
| 36 enum FillMode { |
| 37 FillModeNone, |
| 38 FillModeForwards, |
| 39 FillModeBackwards, |
| 40 FillModeBoth |
| 41 }; |
| 42 |
| 43 CompositorAnimation(const CompositorAnimationCurve&, TargetProperty, int ani
mationId, int groupId); |
| 44 virtual ~CompositorAnimation(); |
| 45 |
| 46 // An id must be unique. |
| 47 virtual int id(); |
| 48 virtual int group(); |
| 49 |
| 50 virtual TargetProperty targetProperty() const; |
| 51 |
| 52 // This is the number of times that the animation will play. If this |
| 53 // value is zero the animation will not play. If it is negative, then |
| 54 // the animation will loop indefinitely. |
| 55 virtual double iterations() const; |
| 56 virtual void setIterations(double); |
| 57 |
| 58 virtual double startTime() const; |
| 59 virtual void setStartTime(double monotonicTime); |
| 60 |
| 61 virtual double timeOffset() const; |
| 62 virtual void setTimeOffset(double monotonicTime); |
| 63 |
| 64 virtual Direction direction() const; |
| 65 virtual void setDirection(Direction); |
| 66 |
| 67 virtual double playbackRate() const; |
| 68 virtual void setPlaybackRate(double); |
| 69 |
| 70 virtual FillMode fillMode() const; |
| 71 virtual void setFillMode(FillMode); |
| 72 |
| 73 virtual double iterationStart() const; |
| 74 virtual void setIterationStart(double); |
| 75 |
| 76 scoped_ptr<cc::Animation> passAnimation(); |
| 77 |
| 78 // Removes ownership over cc animation. Identical to PassAnimation. |
| 79 // TODO(loyso): Erase this method. crbug.com/575041 |
| 80 cc::Animation* releaseCCAnimation(); |
| 81 |
| 82 protected: |
| 83 CompositorAnimation(); |
| 84 |
| 85 private: |
| 86 scoped_ptr<cc::Animation> m_animation; |
| 87 }; |
| 88 |
| 89 } // namespace blink |
| 90 |
| 91 #endif // CompositorAnimation_h |
OLD | NEW |