Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / public / platform / WebCompositorAnimation.h
blobce8c629d919c63396a0f69f7cb6f50d9bcc32e3e
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.
5 #ifndef WebCompositorAnimation_h
6 #define WebCompositorAnimation_h
8 namespace blink {
10 // A compositor driven animation.
11 class WebCompositorAnimation {
12 public:
13 enum TargetProperty {
14 TargetPropertyTransform = 0,
15 TargetPropertyOpacity,
16 TargetPropertyFilter,
17 TargetPropertyScrollOffset
20 enum Direction {
21 DirectionNormal = 0,
22 DirectionReverse,
23 DirectionAlternate,
24 DirectionAlternateReverse
27 enum FillMode {
28 FillModeNone = 0,
29 FillModeForwards,
30 FillModeBackwards,
31 FillModeBoth
34 virtual ~WebCompositorAnimation() { }
36 // An id must be unique.
37 virtual int id() = 0;
38 virtual int group() = 0;
40 virtual TargetProperty targetProperty() const = 0;
42 // This is the number of times that the animation will play. If this
43 // value is zero the animation will not play. If it is negative, then
44 // the animation will loop indefinitely.
45 virtual double iterations() const = 0;
46 virtual void setIterations(double) = 0;
48 virtual double startTime() const = 0;
49 virtual void setStartTime(double monotonicTime) = 0;
51 virtual double timeOffset() const = 0;
52 virtual void setTimeOffset(double monotonicTime) = 0;
54 virtual Direction direction() const = 0;
55 virtual void setDirection(Direction) = 0;
57 virtual double playbackRate() const = 0;
58 virtual void setPlaybackRate(double) = 0;
60 virtual FillMode fillMode() const = 0;
61 virtual void setFillMode(FillMode) = 0;
63 virtual double iterationStart() const = 0;
64 virtual void setIterationStart(double) = 0;
67 } // namespace blink
69 #endif // WebCompositorAnimation_h