| 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 } | 498 } |
| 499 | 499 |
| 500 bool AnimationHost::HasActiveAnimationForTesting(ElementId element_id) const { | 500 bool AnimationHost::HasActiveAnimationForTesting(ElementId element_id) const { |
| 501 auto element_animations = GetElementAnimationsForElementId(element_id); | 501 auto element_animations = GetElementAnimationsForElementId(element_id); |
| 502 return element_animations ? element_animations->HasActiveAnimation() : false; | 502 return element_animations ? element_animations->HasActiveAnimation() : false; |
| 503 } | 503 } |
| 504 | 504 |
| 505 void AnimationHost::ImplOnlyScrollAnimationCreate( | 505 void AnimationHost::ImplOnlyScrollAnimationCreate( |
| 506 ElementId element_id, | 506 ElementId element_id, |
| 507 const gfx::ScrollOffset& target_offset, | 507 const gfx::ScrollOffset& target_offset, |
| 508 const gfx::ScrollOffset& current_offset) { | 508 const gfx::ScrollOffset& current_offset, |
| 509 base::TimeTicks original_event_time) { |
| 509 DCHECK(scroll_offset_animations_impl_); | 510 DCHECK(scroll_offset_animations_impl_); |
| 510 scroll_offset_animations_impl_->ScrollAnimationCreate( | 511 scroll_offset_animations_impl_->ScrollAnimationCreate( |
| 511 element_id, target_offset, current_offset); | 512 element_id, target_offset, current_offset, original_event_time); |
| 512 } | 513 } |
| 513 | 514 |
| 514 bool AnimationHost::ImplOnlyScrollAnimationUpdateTarget( | 515 bool AnimationHost::ImplOnlyScrollAnimationUpdateTarget( |
| 515 ElementId element_id, | 516 ElementId element_id, |
| 516 const gfx::Vector2dF& scroll_delta, | 517 const gfx::Vector2dF& scroll_delta, |
| 517 const gfx::ScrollOffset& max_scroll_offset, | 518 const gfx::ScrollOffset& max_scroll_offset, |
| 518 base::TimeTicks frame_monotonic_time) { | 519 base::TimeTicks frame_monotonic_time) { |
| 519 DCHECK(scroll_offset_animations_impl_); | 520 DCHECK(scroll_offset_animations_impl_); |
| 520 return scroll_offset_animations_impl_->ScrollAnimationUpdateTarget( | 521 return scroll_offset_animations_impl_->ScrollAnimationUpdateTarget( |
| 521 element_id, scroll_delta, max_scroll_offset, frame_monotonic_time); | 522 element_id, scroll_delta, max_scroll_offset, frame_monotonic_time); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 const AnimationHost::ElementToAnimationsMap& | 567 const AnimationHost::ElementToAnimationsMap& |
| 567 AnimationHost::all_element_animations_for_testing() const { | 568 AnimationHost::all_element_animations_for_testing() const { |
| 568 return element_to_animations_map_; | 569 return element_to_animations_map_; |
| 569 } | 570 } |
| 570 | 571 |
| 571 void AnimationHost::OnAnimationWaitingForDeletion() { | 572 void AnimationHost::OnAnimationWaitingForDeletion() { |
| 572 animation_waiting_for_deletion_ = true; | 573 animation_waiting_for_deletion_ = true; |
| 573 } | 574 } |
| 574 | 575 |
| 575 } // namespace cc | 576 } // namespace cc |
| OLD | NEW |