Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: cc/test/animation_timelines_test_common.cc

Issue 2340923003: CC Animation: Rework iterations over players to use the range-based for loop. (Closed)
Patch Set: Rebase. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/animation_test_common.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/test/animation_test_common.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698