OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 WebCompositorAnimation_h | 5 #ifndef WebCompositorAnimation_h |
6 #define WebCompositorAnimation_h | 6 #define WebCompositorAnimation_h |
7 | 7 |
8 namespace blink { | 8 #include "WebAnimation.h" |
9 | |
10 // A compositor driven animation. | |
11 class WebCompositorAnimation { | |
12 public: | |
13 enum TargetProperty { | |
14 TargetPropertyTransform = 0, | |
15 TargetPropertyOpacity, | |
16 TargetPropertyFilter, | |
17 TargetPropertyScrollOffset | |
18 }; | |
19 | |
20 virtual ~WebCompositorAnimation() { } | |
21 | |
22 // An id is effectively the animation's name, and it is not unique. | |
23 virtual int id() = 0; | |
24 | |
25 virtual TargetProperty targetProperty() const = 0; | |
26 | |
27 // This is the number of times that the animation will play. If this | |
28 // value is zero the animation will not play. If it is negative, then | |
29 // the animation will loop indefinitely. | |
30 virtual int iterations() const = 0; | |
31 virtual void setIterations(int) = 0; | |
32 | |
33 virtual double startTime() const = 0; | |
34 virtual void setStartTime(double monotonicTime) = 0; | |
35 | |
36 virtual double timeOffset() const = 0; | |
37 virtual void setTimeOffset(double monotonicTime) = 0; | |
38 | |
39 // If alternatesDirection is true, on odd numbered iterations we reverse the
curve. | |
40 virtual bool alternatesDirection() const = 0; | |
41 virtual void setAlternatesDirection(bool) = 0; | |
42 }; | |
43 | |
44 } // namespace blink | |
45 | 9 |
46 #endif // WebCompositorAnimation_h | 10 #endif // WebCompositorAnimation_h |
OLD | NEW |