OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ANIMATION_ELEMENT_ANIMATIONS_H_ | 5 #ifndef CC_ANIMATION_ELEMENT_ANIMATIONS_H_ |
6 #define CC_ANIMATION_ELEMENT_ANIMATIONS_H_ | 6 #define CC_ANIMATION_ELEMENT_ANIMATIONS_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 namespace cc { | 28 namespace cc { |
29 | 29 |
30 class AnimationDelegate; | 30 class AnimationDelegate; |
31 class AnimationEvents; | 31 class AnimationEvents; |
32 class AnimationHost; | 32 class AnimationHost; |
33 class AnimationPlayer; | 33 class AnimationPlayer; |
34 class FilterOperations; | 34 class FilterOperations; |
35 class KeyframeValueList; | 35 class KeyframeValueList; |
36 enum class ElementListType; | 36 enum class ElementListType; |
| 37 enum class AnimationChangeType; |
37 | 38 |
38 // An ElementAnimations owns a list of all AnimationPlayers, attached to | 39 // An ElementAnimations owns a list of all AnimationPlayers, attached to |
39 // the element. | 40 // the element. |
40 // This is a CC counterpart for blink::ElementAnimations (in 1:1 relationship). | 41 // This is a CC counterpart for blink::ElementAnimations (in 1:1 relationship). |
41 // No pointer to/from respective blink::ElementAnimations object for now. | 42 // No pointer to/from respective blink::ElementAnimations object for now. |
42 class CC_EXPORT ElementAnimations : public base::RefCounted<ElementAnimations> { | 43 class CC_EXPORT ElementAnimations : public base::RefCounted<ElementAnimations> { |
43 public: | 44 public: |
44 static scoped_refptr<ElementAnimations> Create(); | 45 static scoped_refptr<ElementAnimations> Create(); |
45 | 46 |
46 ElementId element_id() const { return element_id_; } | 47 ElementId element_id() const { return element_id_; } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 bool notify_pending_elements); | 223 bool notify_pending_elements); |
223 | 224 |
224 void NotifyClientAnimationWaitingForDeletion(); | 225 void NotifyClientAnimationWaitingForDeletion(); |
225 | 226 |
226 void NotifyClientTransformIsPotentiallyAnimatingChanged( | 227 void NotifyClientTransformIsPotentiallyAnimatingChanged( |
227 bool notify_active_elements, | 228 bool notify_active_elements, |
228 bool notify_pending_elements); | 229 bool notify_pending_elements); |
229 | 230 |
230 void UpdatePotentiallyAnimatingTransform(); | 231 void UpdatePotentiallyAnimatingTransform(); |
231 | 232 |
| 233 void NotifyClientOpacityAnimationChanged( |
| 234 bool notify_active_elements_about_potential_animation, |
| 235 bool notify_active_elements_about_running_animation, |
| 236 bool notify_pending_elements_about_potential_aniamtion, |
| 237 bool notify_pending_elements_about_running_animation); |
| 238 |
| 239 void UpdateAnimatingOpacity(); |
| 240 |
232 void OnFilterAnimated(ElementListType list_type, | 241 void OnFilterAnimated(ElementListType list_type, |
233 const FilterOperations& filters); | 242 const FilterOperations& filters); |
234 void OnOpacityAnimated(ElementListType list_type, float opacity); | 243 void OnOpacityAnimated(ElementListType list_type, float opacity); |
235 void OnTransformAnimated(ElementListType list_type, | 244 void OnTransformAnimated(ElementListType list_type, |
236 const gfx::Transform& transform); | 245 const gfx::Transform& transform); |
237 void OnScrollOffsetAnimated(ElementListType list_type, | 246 void OnScrollOffsetAnimated(ElementListType list_type, |
238 const gfx::ScrollOffset& scroll_offset); | 247 const gfx::ScrollOffset& scroll_offset); |
239 void OnAnimationWaitingForDeletion(); | 248 void OnAnimationWaitingForDeletion(); |
240 void OnTransformIsPotentiallyAnimatingChanged(ElementListType list_type, | 249 void OnTransformIsPotentiallyAnimatingChanged(ElementListType list_type, |
241 bool is_animating); | 250 bool is_animating); |
| 251 void OnOpacityIsAnimatingChanged(ElementListType list_type, |
| 252 AnimationChangeType change_type, |
| 253 bool is_animating); |
242 gfx::ScrollOffset ScrollOffsetForAnimation() const; | 254 gfx::ScrollOffset ScrollOffsetForAnimation() const; |
243 | 255 |
244 void NotifyPlayersAnimationStarted(base::TimeTicks monotonic_time, | 256 void NotifyPlayersAnimationStarted(base::TimeTicks monotonic_time, |
245 TargetProperty::Type target_property, | 257 TargetProperty::Type target_property, |
246 int group); | 258 int group); |
247 void NotifyPlayersAnimationFinished(base::TimeTicks monotonic_time, | 259 void NotifyPlayersAnimationFinished(base::TimeTicks monotonic_time, |
248 TargetProperty::Type target_property, | 260 TargetProperty::Type target_property, |
249 int group); | 261 int group); |
250 void NotifyPlayersAnimationAborted(base::TimeTicks monotonic_time, | 262 void NotifyPlayersAnimationAborted(base::TimeTicks monotonic_time, |
251 TargetProperty::Type target_property, | 263 TargetProperty::Type target_property, |
(...skipping 19 matching lines...) Expand all Loading... |
271 | 283 |
272 // Only try to start animations when new animations are added or when the | 284 // Only try to start animations when new animations are added or when the |
273 // previous attempt at starting animations failed to start all animations. | 285 // previous attempt at starting animations failed to start all animations. |
274 bool needs_to_start_animations_; | 286 bool needs_to_start_animations_; |
275 | 287 |
276 bool scroll_offset_animation_was_interrupted_; | 288 bool scroll_offset_animation_was_interrupted_; |
277 | 289 |
278 bool potentially_animating_transform_for_active_elements_; | 290 bool potentially_animating_transform_for_active_elements_; |
279 bool potentially_animating_transform_for_pending_elements_; | 291 bool potentially_animating_transform_for_pending_elements_; |
280 | 292 |
| 293 bool currently_running_opacity_animation_for_active_elements_; |
| 294 bool currently_running_opacity_animation_for_pending_elements_; |
| 295 bool potentially_animating_opacity_for_active_elements_; |
| 296 bool potentially_animating_opacity_for_pending_elements_; |
| 297 |
281 DISALLOW_COPY_AND_ASSIGN(ElementAnimations); | 298 DISALLOW_COPY_AND_ASSIGN(ElementAnimations); |
282 }; | 299 }; |
283 | 300 |
284 } // namespace cc | 301 } // namespace cc |
285 | 302 |
286 #endif // CC_ANIMATION_ELEMENT_ANIMATIONS_H_ | 303 #endif // CC_ANIMATION_ELEMENT_ANIMATIONS_H_ |
OLD | NEW |