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

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

Issue 1944623002: CC Animation: Use ElementId to attach CC animation players. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erasedomids
Patch Set: Created 4 years, 7 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
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/thread_task_runner_handle.h" 7 #include "base/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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 65
66 scoped_refptr<AnimationPlayer> player = 66 scoped_refptr<AnimationPlayer> player =
67 AnimationPlayer::Create(last_player_id); 67 AnimationPlayer::Create(last_player_id);
68 last_player_id = AnimationIdProvider::NextPlayerId(); 68 last_player_id = AnimationIdProvider::NextPlayerId();
69 69
70 timeline->AttachPlayer(player); 70 timeline->AttachPlayer(player);
71 player->AttachElement(layer->id()); 71 player->AttachElement2(layer->id());
72 EXPECT_TRUE(player->element_animations()); 72 EXPECT_TRUE(player->element_animations());
73 } 73 }
74 74
75 // Create impl players. 75 // Create impl players.
76 layer_tree_host_->CommitAndCreateLayerImplTree(); 76 layer_tree_host_->CommitAndCreateLayerImplTree();
77 77
78 // Check impl instances created. 78 // Check impl instances created.
79 scoped_refptr<AnimationTimeline> timeline_impl = 79 scoped_refptr<AnimationTimeline> timeline_impl =
80 host_impl()->GetTimelineById(timeline->id()); 80 host_impl()->GetTimelineById(timeline->id());
81 EXPECT_TRUE(timeline_impl); 81 EXPECT_TRUE(timeline_impl);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 CreateTimelines(10); 132 CreateTimelines(10);
133 DoTest(); 133 DoTest();
134 } 134 }
135 135
136 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) { 136 TEST_F(AnimationHostPerfTest, Push1000TimelinesPropertiesTo) {
137 CreateTimelines(1000); 137 CreateTimelines(1000);
138 DoTest(); 138 DoTest();
139 } 139 }
140 140
141 } // namespace cc 141 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698