| 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 "cc/animation/animation_delegate.h" | 10 #include "cc/animation/animation_delegate.h" |
| 11 #include "cc/animation/animation_events.h" |
| 11 #include "cc/animation/animation_id_provider.h" | 12 #include "cc/animation/animation_id_provider.h" |
| 12 #include "cc/animation/animation_player.h" | 13 #include "cc/animation/animation_player.h" |
| 13 #include "cc/animation/animation_registrar.h" | 14 #include "cc/animation/animation_registrar.h" |
| 14 #include "cc/animation/animation_timeline.h" | 15 #include "cc/animation/animation_timeline.h" |
| 15 #include "cc/animation/element_animations.h" | 16 #include "cc/animation/element_animations.h" |
| 16 #include "cc/animation/scroll_offset_animation_curve.h" | 17 #include "cc/animation/scroll_offset_animation_curve.h" |
| 17 #include "cc/animation/timing_function.h" | 18 #include "cc/animation/timing_function.h" |
| 18 #include "ui/gfx/geometry/box_f.h" | 19 #include "ui/gfx/geometry/box_f.h" |
| 19 #include "ui/gfx/geometry/scroll_offset.h" | 20 #include "ui/gfx/geometry/scroll_offset.h" |
| 20 | 21 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 346 |
| 346 bool AnimationHost::ActivateAnimations() { | 347 bool AnimationHost::ActivateAnimations() { |
| 347 return animation_registrar_->ActivateAnimations(); | 348 return animation_registrar_->ActivateAnimations(); |
| 348 } | 349 } |
| 349 | 350 |
| 350 bool AnimationHost::AnimateLayers(base::TimeTicks monotonic_time) { | 351 bool AnimationHost::AnimateLayers(base::TimeTicks monotonic_time) { |
| 351 return animation_registrar_->AnimateLayers(monotonic_time); | 352 return animation_registrar_->AnimateLayers(monotonic_time); |
| 352 } | 353 } |
| 353 | 354 |
| 354 bool AnimationHost::UpdateAnimationState(bool start_ready_animations, | 355 bool AnimationHost::UpdateAnimationState(bool start_ready_animations, |
| 355 AnimationEventsVector* events) { | 356 AnimationEvents* events) { |
| 356 return animation_registrar_->UpdateAnimationState(start_ready_animations, | 357 return animation_registrar_->UpdateAnimationState(start_ready_animations, |
| 357 events); | 358 events); |
| 358 } | 359 } |
| 359 | 360 |
| 360 scoped_ptr<AnimationEventsVector> AnimationHost::CreateEvents() { | 361 scoped_ptr<AnimationEvents> AnimationHost::CreateEvents() { |
| 361 return animation_registrar_->CreateEvents(); | 362 return animation_registrar_->CreateEvents(); |
| 362 } | 363 } |
| 363 | 364 |
| 364 void AnimationHost::SetAnimationEvents( | 365 void AnimationHost::SetAnimationEvents(scoped_ptr<AnimationEvents> events) { |
| 365 scoped_ptr<AnimationEventsVector> events) { | |
| 366 return animation_registrar_->SetAnimationEvents(std::move(events)); | 366 return animation_registrar_->SetAnimationEvents(std::move(events)); |
| 367 } | 367 } |
| 368 | 368 |
| 369 bool AnimationHost::ScrollOffsetAnimationWasInterrupted(int layer_id) const { | 369 bool AnimationHost::ScrollOffsetAnimationWasInterrupted(int layer_id) const { |
| 370 LayerAnimationController* controller = GetControllerForLayerId(layer_id); | 370 LayerAnimationController* controller = GetControllerForLayerId(layer_id); |
| 371 return controller ? controller->scroll_offset_animation_was_interrupted() | 371 return controller ? controller->scroll_offset_animation_was_interrupted() |
| 372 : false; | 372 : false; |
| 373 } | 373 } |
| 374 | 374 |
| 375 static LayerAnimationController::ObserverType ObserverTypeFromTreeType( | 375 static LayerAnimationController::ObserverType ObserverTypeFromTreeType( |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 int layer_id, | 569 int layer_id, |
| 570 const gfx::Vector2dF& scroll_delta, | 570 const gfx::Vector2dF& scroll_delta, |
| 571 const gfx::ScrollOffset& max_scroll_offset, | 571 const gfx::ScrollOffset& max_scroll_offset, |
| 572 base::TimeTicks frame_monotonic_time) { | 572 base::TimeTicks frame_monotonic_time) { |
| 573 DCHECK(scroll_offset_animations_); | 573 DCHECK(scroll_offset_animations_); |
| 574 return scroll_offset_animations_->ScrollAnimationUpdateTarget( | 574 return scroll_offset_animations_->ScrollAnimationUpdateTarget( |
| 575 layer_id, scroll_delta, max_scroll_offset, frame_monotonic_time); | 575 layer_id, scroll_delta, max_scroll_offset, frame_monotonic_time); |
| 576 } | 576 } |
| 577 | 577 |
| 578 } // namespace cc | 578 } // namespace cc |
| OLD | NEW |