| 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/animation_host.h" | 5 #include "cc/animation/animation_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 bool AnimationHost::HasAnyAnimationTargetingProperty( | 377 bool AnimationHost::HasAnyAnimationTargetingProperty( |
| 378 ElementId element_id, | 378 ElementId element_id, |
| 379 TargetProperty::Type property) const { | 379 TargetProperty::Type property) const { |
| 380 auto element_animations = GetElementAnimationsForElementId(element_id); | 380 auto element_animations = GetElementAnimationsForElementId(element_id); |
| 381 if (!element_animations) | 381 if (!element_animations) |
| 382 return false; | 382 return false; |
| 383 | 383 |
| 384 return !!element_animations->GetAnimation(property); | 384 return !!element_animations->GetAnimation(property); |
| 385 } | 385 } |
| 386 | 386 |
| 387 bool AnimationHost::FilterIsAnimatingOnImplOnly(ElementId element_id) const { | |
| 388 auto element_animations = GetElementAnimationsForElementId(element_id); | |
| 389 if (!element_animations) | |
| 390 return false; | |
| 391 | |
| 392 Animation* animation = | |
| 393 element_animations->GetAnimation(TargetProperty::FILTER); | |
| 394 return animation && animation->is_impl_only(); | |
| 395 } | |
| 396 | |
| 397 bool AnimationHost::OpacityIsAnimatingOnImplOnly(ElementId element_id) const { | |
| 398 auto element_animations = GetElementAnimationsForElementId(element_id); | |
| 399 if (!element_animations) | |
| 400 return false; | |
| 401 | |
| 402 Animation* animation = | |
| 403 element_animations->GetAnimation(TargetProperty::OPACITY); | |
| 404 return animation && animation->is_impl_only(); | |
| 405 } | |
| 406 | |
| 407 bool AnimationHost::ScrollOffsetIsAnimatingOnImplOnly( | 387 bool AnimationHost::ScrollOffsetIsAnimatingOnImplOnly( |
| 408 ElementId element_id) const { | 388 ElementId element_id) const { |
| 409 auto element_animations = GetElementAnimationsForElementId(element_id); | 389 auto element_animations = GetElementAnimationsForElementId(element_id); |
| 410 if (!element_animations) | 390 if (!element_animations) |
| 411 return false; | 391 return false; |
| 412 | 392 |
| 413 Animation* animation = | 393 Animation* animation = |
| 414 element_animations->GetAnimation(TargetProperty::SCROLL_OFFSET); | 394 element_animations->GetAnimation(TargetProperty::SCROLL_OFFSET); |
| 415 return animation && animation->is_impl_only(); | 395 return animation && animation->is_impl_only(); |
| 416 } | 396 } |
| 417 | 397 |
| 418 bool AnimationHost::TransformIsAnimatingOnImplOnly(ElementId element_id) const { | |
| 419 auto element_animations = GetElementAnimationsForElementId(element_id); | |
| 420 if (!element_animations) | |
| 421 return false; | |
| 422 | |
| 423 Animation* animation = | |
| 424 element_animations->GetAnimation(TargetProperty::TRANSFORM); | |
| 425 return animation && animation->is_impl_only(); | |
| 426 } | |
| 427 | |
| 428 bool AnimationHost::HasFilterAnimationThatInflatesBounds( | 398 bool AnimationHost::HasFilterAnimationThatInflatesBounds( |
| 429 ElementId element_id) const { | 399 ElementId element_id) const { |
| 430 auto element_animations = GetElementAnimationsForElementId(element_id); | 400 auto element_animations = GetElementAnimationsForElementId(element_id); |
| 431 return element_animations | 401 return element_animations |
| 432 ? element_animations->HasFilterAnimationThatInflatesBounds() | 402 ? element_animations->HasFilterAnimationThatInflatesBounds() |
| 433 : false; | 403 : false; |
| 434 } | 404 } |
| 435 | 405 |
| 436 bool AnimationHost::HasTransformAnimationThatInflatesBounds( | 406 bool AnimationHost::HasTransformAnimationThatInflatesBounds( |
| 437 ElementId element_id) const { | 407 ElementId element_id) const { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 const AnimationHost::ElementToAnimationsMap& | 543 const AnimationHost::ElementToAnimationsMap& |
| 574 AnimationHost::all_element_animations_for_testing() const { | 544 AnimationHost::all_element_animations_for_testing() const { |
| 575 return element_to_animations_map_; | 545 return element_to_animations_map_; |
| 576 } | 546 } |
| 577 | 547 |
| 578 void AnimationHost::OnAnimationWaitingForDeletion() { | 548 void AnimationHost::OnAnimationWaitingForDeletion() { |
| 579 animation_waiting_for_deletion_ = true; | 549 animation_waiting_for_deletion_ = true; |
| 580 } | 550 } |
| 581 | 551 |
| 582 } // namespace cc | 552 } // namespace cc |
| OLD | NEW |