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

Side by Side Diff: cc/raster/tile_task_worker_pool_perftest.cc

Issue 1449133002: TaskGraphRunner refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 5 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
« no previous file with comments | « cc/raster/tile_task_worker_pool.cc ('k') | cc/test/layer_tree_test.h » ('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/raster/tile_task_worker_pool.h" 5 #include "cc/raster/tile_task_worker_pool.h"
6 6
7 #include "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "cc/debug/lap_timer.h" 9 #include "cc/debug/lap_timer.h"
10 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
11 #include "cc/raster/bitmap_tile_task_worker_pool.h" 11 #include "cc/raster/bitmap_tile_task_worker_pool.h"
12 #include "cc/raster/gpu_rasterizer.h" 12 #include "cc/raster/gpu_rasterizer.h"
13 #include "cc/raster/gpu_tile_task_worker_pool.h" 13 #include "cc/raster/gpu_tile_task_worker_pool.h"
14 #include "cc/raster/one_copy_tile_task_worker_pool.h" 14 #include "cc/raster/one_copy_tile_task_worker_pool.h"
15 #include "cc/raster/raster_buffer.h" 15 #include "cc/raster/raster_buffer.h"
16 #include "cc/raster/synchronous_task_graph_runner.h"
16 #include "cc/raster/tile_task_runner.h" 17 #include "cc/raster/tile_task_runner.h"
17 #include "cc/raster/zero_copy_tile_task_worker_pool.h" 18 #include "cc/raster/zero_copy_tile_task_worker_pool.h"
18 #include "cc/resources/resource_pool.h" 19 #include "cc/resources/resource_pool.h"
19 #include "cc/resources/resource_provider.h" 20 #include "cc/resources/resource_provider.h"
20 #include "cc/resources/scoped_resource.h" 21 #include "cc/resources/scoped_resource.h"
21 #include "cc/test/fake_output_surface.h" 22 #include "cc/test/fake_output_surface.h"
22 #include "cc/test/fake_output_surface_client.h" 23 #include "cc/test/fake_output_surface_client.h"
23 #include "cc/test/fake_resource_provider.h" 24 #include "cc/test/fake_resource_provider.h"
24 #include "cc/test/test_context_support.h" 25 #include "cc/test/test_context_support.h"
25 #include "cc/test/test_gpu_memory_buffer_manager.h" 26 #include "cc/test/test_gpu_memory_buffer_manager.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 179
179 class TileTaskWorkerPoolPerfTestBase { 180 class TileTaskWorkerPoolPerfTestBase {
180 public: 181 public:
181 typedef std::vector<scoped_refptr<RasterTask>> RasterTaskVector; 182 typedef std::vector<scoped_refptr<RasterTask>> RasterTaskVector;
182 183
183 enum NamedTaskSet { REQUIRED_FOR_ACTIVATION, REQUIRED_FOR_DRAW, ALL }; 184 enum NamedTaskSet { REQUIRED_FOR_ACTIVATION, REQUIRED_FOR_DRAW, ALL };
184 185
185 TileTaskWorkerPoolPerfTestBase() 186 TileTaskWorkerPoolPerfTestBase()
186 : context_provider_(make_scoped_refptr(new PerfContextProvider)), 187 : context_provider_(make_scoped_refptr(new PerfContextProvider)),
187 task_runner_(new base::TestSimpleTaskRunner), 188 task_runner_(new base::TestSimpleTaskRunner),
188 task_graph_runner_(new TaskGraphRunner), 189 task_graph_runner_(new SynchronousTaskGraphRunner),
189 timer_(kWarmupRuns, 190 timer_(kWarmupRuns,
190 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), 191 base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
191 kTimeCheckInterval) {} 192 kTimeCheckInterval) {}
192 193
193 void CreateImageDecodeTasks(unsigned num_image_decode_tasks, 194 void CreateImageDecodeTasks(unsigned num_image_decode_tasks,
194 ImageDecodeTask::Vector* image_decode_tasks) { 195 ImageDecodeTask::Vector* image_decode_tasks) {
195 for (unsigned i = 0; i < num_image_decode_tasks; ++i) 196 for (unsigned i = 0; i < num_image_decode_tasks; ++i)
196 image_decode_tasks->push_back(new PerfImageDecodeTaskImpl); 197 image_decode_tasks->push_back(new PerfImageDecodeTaskImpl);
197 } 198 }
198 199
(...skipping 25 matching lines...) Expand all
224 TileTaskQueue::Item(raster_tasks[i].get(), task_set_collection)); 225 TileTaskQueue::Item(raster_tasks[i].get(), task_set_collection));
225 } 226 }
226 } 227 }
227 228
228 protected: 229 protected:
229 scoped_refptr<ContextProvider> context_provider_; 230 scoped_refptr<ContextProvider> context_provider_;
230 FakeOutputSurfaceClient output_surface_client_; 231 FakeOutputSurfaceClient output_surface_client_;
231 scoped_ptr<FakeOutputSurface> output_surface_; 232 scoped_ptr<FakeOutputSurface> output_surface_;
232 scoped_ptr<ResourceProvider> resource_provider_; 233 scoped_ptr<ResourceProvider> resource_provider_;
233 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; 234 scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
234 scoped_ptr<TaskGraphRunner> task_graph_runner_; 235 scoped_ptr<SynchronousTaskGraphRunner> task_graph_runner_;
235 LapTimer timer_; 236 LapTimer timer_;
236 }; 237 };
237 238
238 class TileTaskWorkerPoolPerfTest 239 class TileTaskWorkerPoolPerfTest
239 : public TileTaskWorkerPoolPerfTestBase, 240 : public TileTaskWorkerPoolPerfTestBase,
240 public testing::TestWithParam<TileTaskWorkerPoolType>, 241 public testing::TestWithParam<TileTaskWorkerPoolType>,
241 public TileTaskRunnerClient { 242 public TileTaskRunnerClient {
242 public: 243 public:
243 // Overridden from testing::Test: 244 // Overridden from testing::Test:
244 void SetUp() override { 245 void SetUp() override {
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 RunBuildTileTaskQueueTest("1_0", 1, 0); 488 RunBuildTileTaskQueueTest("1_0", 1, 0);
488 RunBuildTileTaskQueueTest("32_0", 32, 0); 489 RunBuildTileTaskQueueTest("32_0", 32, 0);
489 RunBuildTileTaskQueueTest("1_1", 1, 1); 490 RunBuildTileTaskQueueTest("1_1", 1, 1);
490 RunBuildTileTaskQueueTest("32_1", 32, 1); 491 RunBuildTileTaskQueueTest("32_1", 32, 1);
491 RunBuildTileTaskQueueTest("1_4", 1, 4); 492 RunBuildTileTaskQueueTest("1_4", 1, 4);
492 RunBuildTileTaskQueueTest("32_4", 32, 4); 493 RunBuildTileTaskQueueTest("32_4", 32, 4);
493 } 494 }
494 495
495 } // namespace 496 } // namespace
496 } // namespace cc 497 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/tile_task_worker_pool.cc ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698