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

Side by Side Diff: cc/trees/layer_tree_host_unittest_animation.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_timelines_test_common.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "cc/animation/animation_curve.h" 9 #include "cc/animation/animation_curve.h"
10 #include "cc/animation/animation_host.h" 10 #include "cc/animation/animation_host.h"
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 851 }
852 852
853 AnimationPlayer& ScrollOffsetPlayer( 853 AnimationPlayer& ScrollOffsetPlayer(
854 const LayerTreeHostImpl& host_impl, 854 const LayerTreeHostImpl& host_impl,
855 scoped_refptr<FakePictureLayer> layer) const { 855 scoped_refptr<FakePictureLayer> layer) const {
856 scoped_refptr<ElementAnimations> element_animations = 856 scoped_refptr<ElementAnimations> element_animations =
857 host_impl.animation_host()->GetElementAnimationsForElementId( 857 host_impl.animation_host()->GetElementAnimationsForElementId(
858 layer->element_id()); 858 layer->element_id());
859 DCHECK(element_animations); 859 DCHECK(element_animations);
860 DCHECK(element_animations->players_list().might_have_observers()); 860 DCHECK(element_animations->players_list().might_have_observers());
861 861 AnimationPlayer* player = &*element_animations->players_list().begin();
862 ElementAnimations::PlayersList::Iterator it(
863 &element_animations->players_list());
864 AnimationPlayer* player = it.GetNext();
865 DCHECK(player); 862 DCHECK(player);
866 return *player; 863 return *player;
867 } 864 }
868 865
869 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 866 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
870 867
871 void DidCommit() override { 868 void DidCommit() override {
872 if (layer_tree_host()->SourceFrameNumber() == 1) { 869 if (layer_tree_host()->SourceFrameNumber() == 1) {
873 // Add an update after the first commit to trigger the animation update 870 // Add an update after the first commit to trigger the animation update
874 // path. 871 // path.
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 private: 1869 private:
1873 scoped_refptr<Layer> layer_; 1870 scoped_refptr<Layer> layer_;
1874 FakeContentLayerClient client_; 1871 FakeContentLayerClient client_;
1875 }; 1872 };
1876 1873
1877 MULTI_THREAD_TEST_F( 1874 MULTI_THREAD_TEST_F(
1878 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); 1875 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit);
1879 1876
1880 } // namespace 1877 } // namespace
1881 } // namespace cc 1878 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/animation_timelines_test_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698