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

Side by Side Diff: cc/layers/picture_layer_unittest.cc

Issue 1385043002: cc: Remove SetLayerTreeHostClientReady() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@startcomp
Patch Set: sky's offline comment Created 5 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/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/scrollbar_layer_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "cc/layers/content_layer_client.h" 8 #include "cc/layers/content_layer_client.h"
9 #include "cc/layers/picture_layer_impl.h" 9 #include "cc/layers/picture_layer_impl.h"
10 #include "cc/playback/display_item_list_settings.h" 10 #include "cc/playback/display_item_list_settings.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 FakePictureLayer::Create(LayerSettings(), &client); 132 FakePictureLayer::Create(LayerSettings(), &client);
133 133
134 LayerTreeHost::InitParams params; 134 LayerTreeHost::InitParams params;
135 params.client = &host_client1; 135 params.client = &host_client1;
136 params.shared_bitmap_manager = &shared_bitmap_manager; 136 params.shared_bitmap_manager = &shared_bitmap_manager;
137 params.settings = &settings; 137 params.settings = &settings;
138 params.task_graph_runner = &task_graph_runner; 138 params.task_graph_runner = &task_graph_runner;
139 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); 139 params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
140 scoped_ptr<LayerTreeHost> host1 = 140 scoped_ptr<LayerTreeHost> host1 =
141 LayerTreeHost::CreateSingleThreaded(&host_client1, &params); 141 LayerTreeHost::CreateSingleThreaded(&host_client1, &params);
142 host1->SetVisible(true);
142 host_client1.SetLayerTreeHost(host1.get()); 143 host_client1.SetLayerTreeHost(host1.get());
143 144
144 params.client = &host_client2; 145 params.client = &host_client2;
145 scoped_ptr<LayerTreeHost> host2 = 146 scoped_ptr<LayerTreeHost> host2 =
146 LayerTreeHost::CreateSingleThreaded(&host_client2, &params); 147 LayerTreeHost::CreateSingleThreaded(&host_client2, &params);
148 host2->SetVisible(true);
147 host_client2.SetLayerTreeHost(host2.get()); 149 host_client2.SetLayerTreeHost(host2.get());
148 150
149 // The PictureLayer is put in one LayerTreeHost. 151 // The PictureLayer is put in one LayerTreeHost.
150 host1->SetRootLayer(layer); 152 host1->SetRootLayer(layer);
151 // Do a main frame, record the picture layers. 153 // Do a main frame, record the picture layers.
152 EXPECT_EQ(0, layer->update_count()); 154 EXPECT_EQ(0, layer->update_count());
153 layer->SetNeedsDisplay(); 155 layer->SetNeedsDisplay();
154 host1->Composite(base::TimeTicks::Now()); 156 host1->Composite(base::TimeTicks::Now());
155 EXPECT_EQ(1, layer->update_count()); 157 EXPECT_EQ(1, layer->update_count());
156 EXPECT_EQ(1, host1->source_frame_number()); 158 EXPECT_EQ(1, host1->source_frame_number());
(...skipping 11 matching lines...) Expand all
168 // Do a main frame, record the picture layers. The frame number has changed 170 // Do a main frame, record the picture layers. The frame number has changed
169 // non-monotonically. 171 // non-monotonically.
170 layer->SetNeedsDisplay(); 172 layer->SetNeedsDisplay();
171 host2->Composite(base::TimeTicks::Now()); 173 host2->Composite(base::TimeTicks::Now());
172 EXPECT_EQ(3, layer->update_count()); 174 EXPECT_EQ(3, layer->update_count());
173 EXPECT_EQ(1, host2->source_frame_number()); 175 EXPECT_EQ(1, host2->source_frame_number());
174 } 176 }
175 177
176 } // namespace 178 } // namespace
177 } // namespace cc 179 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698