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

Side by Side Diff: cc/animation/animation_host_perftest.cc

Issue 2049063002: Revert of Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/animation/animation_host.cc ('k') | cc/animation/animation_player.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/threading/thread_task_runner_handle.h" 7 #include "base/threading/thread_task_runner_handle.h"
8 #include "cc/animation/animation_id_provider.h" 8 #include "cc/animation/animation_id_provider.h"
9 #include "cc/animation/animation_player.h" 9 #include "cc/animation/animation_player.h"
10 #include "cc/animation/animation_timeline.h" 10 #include "cc/animation/animation_timeline.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 scoped_refptr<AnimationTimeline> timeline = 55 scoped_refptr<AnimationTimeline> timeline =
56 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); 56 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId());
57 host()->AddAnimationTimeline(timeline); 57 host()->AddAnimationTimeline(timeline);
58 58
59 const int first_player_id = AnimationIdProvider::NextPlayerId(); 59 const int first_player_id = AnimationIdProvider::NextPlayerId();
60 int last_player_id = first_player_id; 60 int last_player_id = first_player_id;
61 61
62 for (int i = 0; i < num_players; ++i) { 62 for (int i = 0; i < num_players; ++i) {
63 scoped_refptr<Layer> layer = Layer::Create(); 63 scoped_refptr<Layer> layer = Layer::Create();
64 root_layer_->AddChild(layer); 64 root_layer_->AddChild(layer);
65 layer->SetElementId(LayerIdToElementIdForTesting(layer->id()));
66 65
67 scoped_refptr<AnimationPlayer> player = 66 scoped_refptr<AnimationPlayer> player =
68 AnimationPlayer::Create(last_player_id); 67 AnimationPlayer::Create(last_player_id);
69 last_player_id = AnimationIdProvider::NextPlayerId(); 68 last_player_id = AnimationIdProvider::NextPlayerId();
70 69
71 timeline->AttachPlayer(player); 70 timeline->AttachPlayer(player);
72 player->AttachElement(layer->element_id()); 71 player->AttachElement(layer->id());
73 EXPECT_TRUE(player->element_animations()); 72 EXPECT_TRUE(player->element_animations());
74 } 73 }
75 74
76 // Create impl players. 75 // Create impl players.
77 layer_tree_host_->CommitAndCreateLayerImplTree(); 76 layer_tree_host_->CommitAndCreateLayerImplTree();
78 77
79 // Check impl instances created. 78 // Check impl instances created.
80 scoped_refptr<AnimationTimeline> timeline_impl = 79 scoped_refptr<AnimationTimeline> timeline_impl =
81 host_impl()->GetTimelineById(timeline->id()); 80 host_impl()->GetTimelineById(timeline->id());
82 EXPECT_TRUE(timeline_impl); 81 EXPECT_TRUE(timeline_impl);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 CreateTimelines(10); 132 CreateTimelines(10);
134 DoTest(); 133 DoTest();
135 } 134 }
136 135
137 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { 136 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) {
138 CreateTimelines(1000); 137 CreateTimelines(1000);
139 DoTest(); 138 DoTest();
140 } 139 }
141 140
142 } // namespace cc 141 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_host.cc ('k') | cc/animation/animation_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698