| 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 #include "cc/animation/element_animations.h" | 5 #include "cc/animation/element_animations.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 UpdateClientAnimationState(); | 194 UpdateClientAnimationState(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void ElementAnimations::NotifyAnimationPropertyUpdate( | 197 void ElementAnimations::NotifyAnimationPropertyUpdate( |
| 198 const AnimationEvent& event) { | 198 const AnimationEvent& event) { |
| 199 DCHECK(!event.is_impl_only); | 199 DCHECK(!event.is_impl_only); |
| 200 bool notify_active_elements = true; | 200 bool notify_active_elements = true; |
| 201 bool notify_pending_elements = true; | 201 bool notify_pending_elements = true; |
| 202 switch (event.target_property) { | 202 switch (event.target_property) { |
| 203 case TargetProperty::OPACITY: | 203 case TargetProperty::OPACITY: { |
| 204 NotifyClientOpacityAnimated(event.opacity, notify_active_elements, | 204 NotifyClientOpacityAnimated(event.opacity, notify_active_elements, |
| 205 notify_pending_elements); | 205 notify_pending_elements); |
| 206 break; | 206 break; |
| 207 case TargetProperty::TRANSFORM: | 207 } |
| 208 NotifyClientTransformAnimated(event.transform, notify_active_elements, | 208 case TargetProperty::TRANSFORM: { |
| 209 notify_pending_elements); | 209 TransformOperations operations; |
| 210 operations.AppendMatrix(event.transform); |
| 211 NotifyClientTransformOperationsAnimated( |
| 212 operations, notify_active_elements, notify_pending_elements); |
| 210 break; | 213 break; |
| 214 } |
| 211 default: | 215 default: |
| 212 NOTREACHED(); | 216 NOTREACHED(); |
| 213 } | 217 } |
| 214 } | 218 } |
| 215 | 219 |
| 216 bool ElementAnimations::HasFilterAnimationThatInflatesBounds() const { | 220 bool ElementAnimations::HasFilterAnimationThatInflatesBounds() const { |
| 217 for (auto& player : players_list_) { | 221 for (auto& player : players_list_) { |
| 218 if (player.HasFilterAnimationThatInflatesBounds()) | 222 if (player.HasFilterAnimationThatInflatesBounds()) |
| 219 return true; | 223 return true; |
| 220 } | 224 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 void ElementAnimations::NotifyClientOpacityAnimated( | 321 void ElementAnimations::NotifyClientOpacityAnimated( |
| 318 float opacity, | 322 float opacity, |
| 319 bool notify_active_elements, | 323 bool notify_active_elements, |
| 320 bool notify_pending_elements) { | 324 bool notify_pending_elements) { |
| 321 if (notify_active_elements && has_element_in_active_list()) | 325 if (notify_active_elements && has_element_in_active_list()) |
| 322 OnOpacityAnimated(ElementListType::ACTIVE, opacity); | 326 OnOpacityAnimated(ElementListType::ACTIVE, opacity); |
| 323 if (notify_pending_elements && has_element_in_pending_list()) | 327 if (notify_pending_elements && has_element_in_pending_list()) |
| 324 OnOpacityAnimated(ElementListType::PENDING, opacity); | 328 OnOpacityAnimated(ElementListType::PENDING, opacity); |
| 325 } | 329 } |
| 326 | 330 |
| 327 void ElementAnimations::NotifyClientTransformAnimated( | 331 void ElementAnimations::NotifyClientTransformOperationsAnimated( |
| 328 const gfx::Transform& transform, | 332 const TransformOperations& operations, |
| 329 bool notify_active_elements, | 333 bool notify_active_elements, |
| 330 bool notify_pending_elements) { | 334 bool notify_pending_elements) { |
| 335 gfx::Transform transform = operations.Apply(); |
| 331 if (notify_active_elements && has_element_in_active_list()) | 336 if (notify_active_elements && has_element_in_active_list()) |
| 332 OnTransformAnimated(ElementListType::ACTIVE, transform); | 337 OnTransformAnimated(ElementListType::ACTIVE, transform); |
| 333 if (notify_pending_elements && has_element_in_pending_list()) | 338 if (notify_pending_elements && has_element_in_pending_list()) |
| 334 OnTransformAnimated(ElementListType::PENDING, transform); | 339 OnTransformAnimated(ElementListType::PENDING, transform); |
| 335 } | 340 } |
| 336 | 341 |
| 337 void ElementAnimations::NotifyClientFilterAnimated( | 342 void ElementAnimations::NotifyClientFilterAnimated( |
| 338 const FilterOperations& filters, | 343 const FilterOperations& filters, |
| 339 bool notify_active_elements, | 344 bool notify_active_elements, |
| 340 bool notify_pending_elements) { | 345 bool notify_pending_elements) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 if (animation_host()) { | 493 if (animation_host()) { |
| 489 DCHECK(animation_host()->mutator_host_client()); | 494 DCHECK(animation_host()->mutator_host_client()); |
| 490 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( | 495 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( |
| 491 element_id()); | 496 element_id()); |
| 492 } | 497 } |
| 493 | 498 |
| 494 return gfx::ScrollOffset(); | 499 return gfx::ScrollOffset(); |
| 495 } | 500 } |
| 496 | 501 |
| 497 } // namespace cc | 502 } // namespace cc |
| OLD | NEW |