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

Side by Side Diff: cc/test/animation_test_common.h

Issue 95763002: cc: Support animating scroll offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/layers/layer_impl.cc ('k') | cc/test/animation_test_common.cc » ('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 CC_TEST_ANIMATION_TEST_COMMON_H_ 5 #ifndef CC_TEST_ANIMATION_TEST_COMMON_H_
6 #define CC_TEST_ANIMATION_TEST_COMMON_H_ 6 #define CC_TEST_ANIMATION_TEST_COMMON_H_
7 7
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_curve.h" 9 #include "cc/animation/animation_curve.h"
10 #include "cc/animation/layer_animation_controller.h" 10 #include "cc/animation/layer_animation_controller.h"
11 #include "cc/animation/layer_animation_value_observer.h" 11 #include "cc/animation/layer_animation_value_observer.h"
12 #include "cc/animation/layer_animation_value_provider.h"
12 #include "cc/output/filter_operations.h" 13 #include "cc/output/filter_operations.h"
14 #include "cc/test/geometry_test_utils.h"
13 15
14 namespace cc { 16 namespace cc {
15 class LayerImpl; 17 class LayerImpl;
16 class Layer; 18 class Layer;
17 } 19 }
18 20
19 namespace cc { 21 namespace cc {
20 22
21 class FakeFloatAnimationCurve : public FloatAnimationCurve { 23 class FakeFloatAnimationCurve : public FloatAnimationCurve {
22 public: 24 public:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 68
67 class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver { 69 class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver {
68 public: 70 public:
69 FakeLayerAnimationValueObserver(); 71 FakeLayerAnimationValueObserver();
70 virtual ~FakeLayerAnimationValueObserver(); 72 virtual ~FakeLayerAnimationValueObserver();
71 73
72 // LayerAnimationValueObserver implementation 74 // LayerAnimationValueObserver implementation
73 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; 75 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE;
74 virtual void OnOpacityAnimated(float opacity) OVERRIDE; 76 virtual void OnOpacityAnimated(float opacity) OVERRIDE;
75 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; 77 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE;
78 virtual void OnScrollOffsetAnimated(gfx::Vector2dF scroll_offset) OVERRIDE;
76 virtual void OnAnimationWaitingForDeletion() OVERRIDE; 79 virtual void OnAnimationWaitingForDeletion() OVERRIDE;
77 virtual bool IsActive() const OVERRIDE; 80 virtual bool IsActive() const OVERRIDE;
78 81
79 const FilterOperations& filters() const { return filters_; } 82 const FilterOperations& filters() const { return filters_; }
80 float opacity() const { return opacity_; } 83 float opacity() const { return opacity_; }
81 const gfx::Transform& transform() const { return transform_; } 84 const gfx::Transform& transform() const { return transform_; }
85 gfx::Vector2dF scroll_offset() { return scroll_offset_; }
82 86
83 bool animation_waiting_for_deletion() { 87 bool animation_waiting_for_deletion() {
84 return animation_waiting_for_deletion_; 88 return animation_waiting_for_deletion_;
85 } 89 }
86 90
87 private: 91 private:
88 FilterOperations filters_; 92 FilterOperations filters_;
89 float opacity_; 93 float opacity_;
90 gfx::Transform transform_; 94 gfx::Transform transform_;
95 gfx::Vector2dF scroll_offset_;
91 bool animation_waiting_for_deletion_; 96 bool animation_waiting_for_deletion_;
92 }; 97 };
93 98
94 class FakeInactiveLayerAnimationValueObserver 99 class FakeInactiveLayerAnimationValueObserver
95 : public FakeLayerAnimationValueObserver { 100 : public FakeLayerAnimationValueObserver {
96 public: 101 public:
97 virtual bool IsActive() const OVERRIDE; 102 virtual bool IsActive() const OVERRIDE;
98 }; 103 };
99 104
105 class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider {
106 public:
107 virtual gfx::Vector2dF ScrollOffsetForAnimation() const OVERRIDE;
108
109 void set_scroll_offset(gfx::Vector2dF scroll_offset) {
110 scroll_offset_ = scroll_offset;
111 }
112
113 private:
114 gfx::Vector2dF scroll_offset_;
115 };
116
100 int AddOpacityTransitionToController(LayerAnimationController* controller, 117 int AddOpacityTransitionToController(LayerAnimationController* controller,
101 double duration, 118 double duration,
102 float start_opacity, 119 float start_opacity,
103 float end_opacity, 120 float end_opacity,
104 bool use_timing_function); 121 bool use_timing_function);
105 122
106 int AddAnimatedTransformToController(LayerAnimationController* controller, 123 int AddAnimatedTransformToController(LayerAnimationController* controller,
107 double duration, 124 double duration,
108 int delta_x, 125 int delta_x,
109 int delta_y); 126 int delta_y);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 float end_brightness); 158 float end_brightness);
142 159
143 int AddAnimatedFilterToLayer(LayerImpl* layer, 160 int AddAnimatedFilterToLayer(LayerImpl* layer,
144 double duration, 161 double duration,
145 float start_brightness, 162 float start_brightness,
146 float end_brightness); 163 float end_brightness);
147 164
148 } // namespace cc 165 } // namespace cc
149 166
150 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_ 167 #endif // CC_TEST_ANIMATION_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/test/animation_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698