| 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/test/animation_timelines_test_common.h" | 5 #include "cc/test/animation_timelines_test_common.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "cc/animation/animation_events.h" | 8 #include "cc/animation/animation_events.h" |
| 9 #include "cc/animation/animation_id_provider.h" | 9 #include "cc/animation/animation_id_provider.h" |
| 10 #include "cc/animation/animation_player.h" | 10 #include "cc/animation/animation_player.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 431 |
| 432 host_->AnimateLayers(time); | 432 host_->AnimateLayers(time); |
| 433 host_->UpdateAnimationState(true, nullptr); | 433 host_->UpdateAnimationState(true, nullptr); |
| 434 host_->SetAnimationEvents(std::move(events)); | 434 host_->SetAnimationEvents(std::move(events)); |
| 435 } | 435 } |
| 436 | 436 |
| 437 AnimationPlayer* AnimationTimelinesTest::GetPlayerForElementId( | 437 AnimationPlayer* AnimationTimelinesTest::GetPlayerForElementId( |
| 438 ElementId element_id) { | 438 ElementId element_id) { |
| 439 const scoped_refptr<ElementAnimations> element_animations = | 439 const scoped_refptr<ElementAnimations> element_animations = |
| 440 host_->GetElementAnimationsForElementId(element_id); | 440 host_->GetElementAnimationsForElementId(element_id); |
| 441 return element_animations | 441 return element_animations ? &*element_animations->players_list().begin() |
| 442 ? ElementAnimations::PlayersList::Iterator( | 442 : nullptr; |
| 443 &element_animations->players_list()) | |
| 444 .GetNext() | |
| 445 : nullptr; | |
| 446 } | 443 } |
| 447 | 444 |
| 448 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId( | 445 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId( |
| 449 ElementId element_id) { | 446 ElementId element_id) { |
| 450 const scoped_refptr<ElementAnimations> element_animations = | 447 const scoped_refptr<ElementAnimations> element_animations = |
| 451 host_impl_->GetElementAnimationsForElementId(element_id); | 448 host_impl_->GetElementAnimationsForElementId(element_id); |
| 452 return element_animations | 449 return element_animations ? &*element_animations->players_list().begin() |
| 453 ? ElementAnimations::PlayersList::Iterator( | 450 : nullptr; |
| 454 &element_animations->players_list()) | |
| 455 .GetNext() | |
| 456 : nullptr; | |
| 457 } | 451 } |
| 458 | 452 |
| 459 int AnimationTimelinesTest::NextTestLayerId() { | 453 int AnimationTimelinesTest::NextTestLayerId() { |
| 460 next_test_layer_id_++; | 454 next_test_layer_id_++; |
| 461 return next_test_layer_id_; | 455 return next_test_layer_id_; |
| 462 } | 456 } |
| 463 | 457 |
| 464 bool AnimationTimelinesTest::CheckPlayerTimelineNeedsPushProperties( | 458 bool AnimationTimelinesTest::CheckPlayerTimelineNeedsPushProperties( |
| 465 bool needs_push_properties) const { | 459 bool needs_push_properties) const { |
| 466 DCHECK(player_); | 460 DCHECK(player_); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 488 } | 482 } |
| 489 | 483 |
| 490 return result; | 484 return result; |
| 491 } | 485 } |
| 492 | 486 |
| 493 void AnimationTimelinesTest::PushProperties() { | 487 void AnimationTimelinesTest::PushProperties() { |
| 494 host_->PushPropertiesTo(host_impl_); | 488 host_->PushPropertiesTo(host_impl_); |
| 495 } | 489 } |
| 496 | 490 |
| 497 } // namespace cc | 491 } // namespace cc |
| OLD | NEW |