OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
6 #define UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 6 #define UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "cc/animation/animation.h" | 11 #include "cc/animation/animation.h" |
12 #include "cc/animation/animation_events.h" | 12 #include "cc/animation/animation_events.h" |
13 #include "third_party/skia/include/core/SkColor.h" | 13 #include "third_party/skia/include/core/SkColor.h" |
14 #include "ui/base/animation/tween.h" | |
15 #include "ui/compositor/compositor_export.h" | 14 #include "ui/compositor/compositor_export.h" |
| 15 #include "ui/gfx/animation/tween.h" |
16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
17 #include "ui/gfx/transform.h" | 17 #include "ui/gfx/transform.h" |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 | 20 |
21 class InterpolatedTransform; | 21 class InterpolatedTransform; |
22 class LayerAnimationDelegate; | 22 class LayerAnimationDelegate; |
23 | 23 |
24 // LayerAnimationElements represent one segment of an animation between two | 24 // LayerAnimationElements represent one segment of an animation between two |
25 // keyframes. They know how to update a LayerAnimationDelegate given a value | 25 // keyframes. They know how to update a LayerAnimationDelegate given a value |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 // Assigns the target value to |target|. | 176 // Assigns the target value to |target|. |
177 void GetTargetValue(TargetValue* target) const; | 177 void GetTargetValue(TargetValue* target) const; |
178 | 178 |
179 // The properties that the element modifies. | 179 // The properties that the element modifies. |
180 const AnimatableProperties& properties() const { return properties_; } | 180 const AnimatableProperties& properties() const { return properties_; } |
181 | 181 |
182 // Whether this element animates on the compositor thread. | 182 // Whether this element animates on the compositor thread. |
183 virtual bool IsThreaded() const; | 183 virtual bool IsThreaded() const; |
184 | 184 |
185 Tween::Type tween_type() const { return tween_type_; } | 185 gfx::Tween::Type tween_type() const { return tween_type_; } |
186 void set_tween_type(Tween::Type tween_type) { tween_type_ = tween_type; } | 186 void set_tween_type(gfx::Tween::Type tween_type) { tween_type_ = tween_type; } |
187 | 187 |
188 // Each LayerAnimationElement has a unique animation_id. Elements belonging | 188 // Each LayerAnimationElement has a unique animation_id. Elements belonging |
189 // to sequences that are supposed to start together have the same | 189 // to sequences that are supposed to start together have the same |
190 // animation_group_id. | 190 // animation_group_id. |
191 int animation_id() const { return animation_id_; } | 191 int animation_id() const { return animation_id_; } |
192 int animation_group_id() const { return animation_group_id_; } | 192 int animation_group_id() const { return animation_group_id_; } |
193 void set_animation_group_id(int id) { animation_group_id_ = id; } | 193 void set_animation_group_id(int id) { animation_group_id_ = id; } |
194 | 194 |
195 base::TimeDelta duration() const { return duration_; } | 195 base::TimeDelta duration() const { return duration_; } |
196 | 196 |
(...skipping 20 matching lines...) Expand all Loading... |
217 // useful to slow animations down to see them more clearly. | 217 // useful to slow animations down to see them more clearly. |
218 base::TimeDelta GetEffectiveDuration(const base::TimeDelta& delta); | 218 base::TimeDelta GetEffectiveDuration(const base::TimeDelta& delta); |
219 | 219 |
220 bool first_frame_; | 220 bool first_frame_; |
221 const AnimatableProperties properties_; | 221 const AnimatableProperties properties_; |
222 base::TimeTicks requested_start_time_; | 222 base::TimeTicks requested_start_time_; |
223 | 223 |
224 // When the animation actually started, taking into account queueing delays. | 224 // When the animation actually started, taking into account queueing delays. |
225 base::TimeTicks effective_start_time_; | 225 base::TimeTicks effective_start_time_; |
226 const base::TimeDelta duration_; | 226 const base::TimeDelta duration_; |
227 Tween::Type tween_type_; | 227 gfx::Tween::Type tween_type_; |
228 | 228 |
229 const int animation_id_; | 229 const int animation_id_; |
230 int animation_group_id_; | 230 int animation_group_id_; |
231 | 231 |
232 double last_progressed_fraction_; | 232 double last_progressed_fraction_; |
233 | 233 |
234 DISALLOW_ASSIGN(LayerAnimationElement); | 234 DISALLOW_ASSIGN(LayerAnimationElement); |
235 }; | 235 }; |
236 | 236 |
237 } // namespace ui | 237 } // namespace ui |
238 | 238 |
239 #endif // UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ | 239 #endif // UI_COMPOSITOR_LAYER_ANIMATION_ELEMENT_H_ |
OLD | NEW |