Home | History | Annotate | Download | only in platform
      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 WebCompositorAnimation_h
      6 #define WebCompositorAnimation_h
      7 
      8 #define WEB_ANIMATION_SUPPORTS_FILL_MODE 1
      9 
     10 namespace blink {
     11 
     12 // A compositor driven animation.
     13 class WebCompositorAnimation {
     14 public:
     15     enum TargetProperty {
     16         TargetPropertyTransform = 0,
     17         TargetPropertyOpacity,
     18         TargetPropertyFilter,
     19         TargetPropertyScrollOffset
     20     };
     21 
     22     enum Direction {
     23         DirectionNormal = 0,
     24         DirectionReverse,
     25         DirectionAlternate,
     26         DirectionAlternateReverse
     27     };
     28 
     29     enum FillMode {
     30         FillModeNone = 0,
     31         FillModeForwards,
     32         FillModeBackwards,
     33         FillModeBoth
     34     };
     35 
     36     virtual ~WebCompositorAnimation() { }
     37 
     38     // An id is effectively the animation's name, and it is not unique.
     39     virtual int id() = 0;
     40 
     41     virtual TargetProperty targetProperty() const = 0;
     42 
     43     // This is the number of times that the animation will play. If this
     44     // value is zero the animation will not play. If it is negative, then
     45     // the animation will loop indefinitely.
     46     virtual double iterations() const = 0;
     47     virtual void setIterations(double) = 0;
     48 
     49     virtual double startTime() const = 0;
     50     virtual void setStartTime(double monotonicTime) = 0;
     51 
     52     virtual double timeOffset() const = 0;
     53     virtual void setTimeOffset(double monotonicTime) = 0;
     54 
     55     virtual Direction direction() const = 0;
     56     virtual void setDirection(Direction) = 0;
     57 
     58     virtual double playbackRate() const = 0;
     59     virtual void setPlaybackRate(double) = 0;
     60 
     61     virtual FillMode fillMode() const = 0;
     62     virtual void setFillMode(FillMode)  = 0;
     63 
     64     virtual double iterationStart() const = 0;
     65     virtual void setIterationStart(double) = 0;
     66 };
     67 
     68 } // namespace blink
     69 
     70 #endif // WebCompositorAnimation_h
     71