Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: cc/animation_curve.h

Issue 11365025: Make cc a component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/active_animation.h ('k') | cc/bitmap_content_layer_updater.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 CCAnimationCurve_h 5 #ifndef CCAnimationCurve_h
6 #define CCAnimationCurve_h 6 #define CCAnimationCurve_h
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/cc_export.h"
9 #include <public/WebTransformationMatrix.h> 10 #include <public/WebTransformationMatrix.h>
10 11
11 namespace cc { 12 namespace cc {
12 13
13 class FloatAnimationCurve; 14 class FloatAnimationCurve;
14 class TransformAnimationCurve; 15 class TransformAnimationCurve;
15 class TransformOperations; 16 class TransformOperations;
16 17
17 // An animation curve is a function that returns a value given a time. 18 // An animation curve is a function that returns a value given a time.
18 // There are currently only two types of curve, float and transform. 19 // There are currently only two types of curve, float and transform.
19 class AnimationCurve { 20 class CC_EXPORT AnimationCurve {
20 public: 21 public:
21 enum Type { Float, Transform }; 22 enum Type { Float, Transform };
22 23
23 virtual ~AnimationCurve() { } 24 virtual ~AnimationCurve() { }
24 25
25 virtual double duration() const = 0; 26 virtual double duration() const = 0;
26 virtual Type type() const = 0; 27 virtual Type type() const = 0;
27 virtual scoped_ptr<AnimationCurve> clone() const = 0; 28 virtual scoped_ptr<AnimationCurve> clone() const = 0;
28 29
29 const FloatAnimationCurve* toFloatAnimationCurve() const; 30 const FloatAnimationCurve* toFloatAnimationCurve() const;
30 const TransformAnimationCurve* toTransformAnimationCurve() const; 31 const TransformAnimationCurve* toTransformAnimationCurve() const;
31 }; 32 };
32 33
33 class FloatAnimationCurve : public AnimationCurve { 34 class CC_EXPORT FloatAnimationCurve : public AnimationCurve {
34 public: 35 public:
35 virtual ~FloatAnimationCurve() { } 36 virtual ~FloatAnimationCurve() { }
36 37
37 virtual float getValue(double t) const = 0; 38 virtual float getValue(double t) const = 0;
38 39
39 // Partial Animation implementation. 40 // Partial Animation implementation.
40 virtual Type type() const OVERRIDE; 41 virtual Type type() const OVERRIDE;
41 }; 42 };
42 43
43 class TransformAnimationCurve : public AnimationCurve { 44 class CC_EXPORT TransformAnimationCurve : public AnimationCurve {
44 public: 45 public:
45 virtual ~TransformAnimationCurve() { } 46 virtual ~TransformAnimationCurve() { }
46 47
47 virtual WebKit::WebTransformationMatrix getValue(double t) const = 0; 48 virtual WebKit::WebTransformationMatrix getValue(double t) const = 0;
48 49
49 // Partial Animation implementation. 50 // Partial Animation implementation.
50 virtual Type type() const OVERRIDE; 51 virtual Type type() const OVERRIDE;
51 }; 52 };
52 53
53 } // namespace cc 54 } // namespace cc
54 55
55 #endif // CCAnimation_h 56 #endif // CCAnimation_h
OLDNEW
« no previous file with comments | « cc/active_animation.h ('k') | cc/bitmap_content_layer_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698