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

Side by Side Diff: cc/debug/rasterize_and_record_benchmark_impl.cc

Issue 786583002: cc: Renaming Rasterizer and RasterWorkerPool interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Update include files alphabetic orders. Created 6 years 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 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/debug/rasterize_and_record_benchmark_impl.h" 5 #include "cc/debug/rasterize_and_record_benchmark_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "cc/debug/lap_timer.h" 12 #include "cc/debug/lap_timer.h"
13 #include "cc/layers/layer_impl.h" 13 #include "cc/layers/layer_impl.h"
14 #include "cc/layers/picture_layer_impl.h" 14 #include "cc/layers/picture_layer_impl.h"
15 #include "cc/resources/raster_worker_pool.h" 15 #include "cc/resources/tile_task_worker_pool.h"
16 #include "cc/trees/layer_tree_host_common.h" 16 #include "cc/trees/layer_tree_host_common.h"
17 #include "cc/trees/layer_tree_host_impl.h" 17 #include "cc/trees/layer_tree_host_impl.h"
18 #include "ui/gfx/geometry/rect.h" 18 #include "ui/gfx/geometry/rect.h"
19 19
20 namespace cc { 20 namespace cc {
21 21
22 namespace { 22 namespace {
23 23
24 const int kDefaultRasterizeRepeatCount = 100; 24 const int kDefaultRasterizeRepeatCount = 100;
25 25
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 rasterize_results_.total_picture_layers++; 200 rasterize_results_.total_picture_layers++;
201 if (!layer->CanHaveTilings()) { 201 if (!layer->CanHaveTilings()) {
202 rasterize_results_.total_picture_layers_with_no_content++; 202 rasterize_results_.total_picture_layers_with_no_content++;
203 return; 203 return;
204 } 204 }
205 if (layer->visible_content_rect().IsEmpty()) { 205 if (layer->visible_content_rect().IsEmpty()) {
206 rasterize_results_.total_picture_layers_off_screen++; 206 rasterize_results_.total_picture_layers_off_screen++;
207 return; 207 return;
208 } 208 }
209 209
210 TaskGraphRunner* task_graph_runner = RasterWorkerPool::GetTaskGraphRunner(); 210 TaskGraphRunner* task_graph_runner = TileTaskWorkerPool::GetTaskGraphRunner();
211 DCHECK(task_graph_runner); 211 DCHECK(task_graph_runner);
212 212
213 if (!task_namespace_.IsValid()) 213 if (!task_namespace_.IsValid())
214 task_namespace_ = task_graph_runner->GetNamespaceToken(); 214 task_namespace_ = task_graph_runner->GetNamespaceToken();
215 215
216 FixedInvalidationPictureLayerTilingClient client( 216 FixedInvalidationPictureLayerTilingClient client(
217 layer, gfx::Rect(layer->content_bounds())); 217 layer, gfx::Rect(layer->content_bounds()));
218 auto tiling_set = PictureLayerTilingSet::Create(&client); 218 auto tiling_set = PictureLayerTilingSet::Create(&client);
219 219
220 PictureLayerTiling* tiling = 220 PictureLayerTiling* tiling =
(...skipping 12 matching lines...) Expand all
233 scoped_refptr<BenchmarkRasterTask> benchmark_raster_task( 233 scoped_refptr<BenchmarkRasterTask> benchmark_raster_task(
234 new BenchmarkRasterTask(raster_source, 234 new BenchmarkRasterTask(raster_source,
235 content_rect, 235 content_rect,
236 contents_scale, 236 contents_scale,
237 rasterize_repeat_count_)); 237 rasterize_repeat_count_));
238 238
239 TaskGraph graph; 239 TaskGraph graph;
240 240
241 graph.nodes.push_back( 241 graph.nodes.push_back(
242 TaskGraph::Node(benchmark_raster_task.get(), 242 TaskGraph::Node(benchmark_raster_task.get(),
243 RasterWorkerPool::kBenchmarkRasterTaskPriority, 243 TileTaskWorkerPool::kBenchmarkTaskPriority, 0u));
244 0u));
245 244
246 task_graph_runner->ScheduleTasks(task_namespace_, &graph); 245 task_graph_runner->ScheduleTasks(task_namespace_, &graph);
247 task_graph_runner->WaitForTasksToFinishRunning(task_namespace_); 246 task_graph_runner->WaitForTasksToFinishRunning(task_namespace_);
248 247
249 Task::Vector completed_tasks; 248 Task::Vector completed_tasks;
250 task_graph_runner->CollectCompletedTasks(task_namespace_, &completed_tasks); 249 task_graph_runner->CollectCompletedTasks(task_namespace_, &completed_tasks);
251 DCHECK_EQ(1u, completed_tasks.size()); 250 DCHECK_EQ(1u, completed_tasks.size());
252 DCHECK_EQ(completed_tasks[0], benchmark_raster_task); 251 DCHECK_EQ(completed_tasks[0], benchmark_raster_task);
253 252
254 int tile_size = content_rect.width() * content_rect.height(); 253 int tile_size = content_rect.width() * content_rect.height();
(...skipping 23 matching lines...) Expand all
278 total_memory_usage(0), 277 total_memory_usage(0),
279 total_layers(0), 278 total_layers(0),
280 total_picture_layers(0), 279 total_picture_layers(0),
281 total_picture_layers_with_no_content(0), 280 total_picture_layers_with_no_content(0),
282 total_picture_layers_off_screen(0) { 281 total_picture_layers_off_screen(0) {
283 } 282 }
284 283
285 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} 284 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {}
286 285
287 } // namespace cc 286 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698