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

Side by Side Diff: cc/resources/raster_worker_pool_perftest.cc

Issue 734063004: Update from https://crrev.com/304418 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/resources/picture_pile_unittest.cc ('k') | cc/resources/raster_worker_pool_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/resources/raster_worker_pool.h" 5 #include "cc/resources/raster_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"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 scoped_ptr<TaskGraphRunner> task_graph_runner_; 221 scoped_ptr<TaskGraphRunner> task_graph_runner_;
222 LapTimer timer_; 222 LapTimer timer_;
223 }; 223 };
224 224
225 class RasterWorkerPoolPerfTest 225 class RasterWorkerPoolPerfTest
226 : public RasterWorkerPoolPerfTestBase, 226 : public RasterWorkerPoolPerfTestBase,
227 public testing::TestWithParam<RasterWorkerPoolType>, 227 public testing::TestWithParam<RasterWorkerPoolType>,
228 public RasterizerClient { 228 public RasterizerClient {
229 public: 229 public:
230 // Overridden from testing::Test: 230 // Overridden from testing::Test:
231 virtual void SetUp() override { 231 void SetUp() override {
232 switch (GetParam()) { 232 switch (GetParam()) {
233 case RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER: 233 case RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER:
234 Create3dOutputSurfaceAndResourceProvider(); 234 Create3dOutputSurfaceAndResourceProvider();
235 raster_worker_pool_ = PixelBufferRasterWorkerPool::Create( 235 raster_worker_pool_ = PixelBufferRasterWorkerPool::Create(
236 task_runner_.get(), 236 task_runner_.get(),
237 task_graph_runner_.get(), 237 task_graph_runner_.get(),
238 context_provider_.get(), 238 context_provider_.get(),
239 resource_provider_.get(), 239 resource_provider_.get(),
240 std::numeric_limits<size_t>::max()); 240 std::numeric_limits<size_t>::max());
241 break; 241 break;
(...skipping 28 matching lines...) Expand all
270 raster_worker_pool_ = 270 raster_worker_pool_ =
271 BitmapRasterWorkerPool::Create(task_runner_.get(), 271 BitmapRasterWorkerPool::Create(task_runner_.get(),
272 task_graph_runner_.get(), 272 task_graph_runner_.get(),
273 resource_provider_.get()); 273 resource_provider_.get());
274 break; 274 break;
275 } 275 }
276 276
277 DCHECK(raster_worker_pool_); 277 DCHECK(raster_worker_pool_);
278 raster_worker_pool_->AsRasterizer()->SetClient(this); 278 raster_worker_pool_->AsRasterizer()->SetClient(this);
279 } 279 }
280 virtual void TearDown() override { 280 void TearDown() override {
281 raster_worker_pool_->AsRasterizer()->Shutdown(); 281 raster_worker_pool_->AsRasterizer()->Shutdown();
282 raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks(); 282 raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks();
283 } 283 }
284 284
285 // Overriden from RasterizerClient: 285 // Overriden from RasterizerClient:
286 void DidFinishRunningTasks(TaskSet task_set) override { 286 void DidFinishRunningTasks(TaskSet task_set) override {
287 raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks(); 287 raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks();
288 } 288 }
289 TaskSetCollection TasksThatShouldBeForcedToComplete() const override { 289 TaskSetCollection TasksThatShouldBeForcedToComplete() const override {
290 return TaskSetCollection(); 290 return TaskSetCollection();
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 ::testing::Values(RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER, 478 ::testing::Values(RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER,
479 RASTER_WORKER_POOL_TYPE_ZERO_COPY, 479 RASTER_WORKER_POOL_TYPE_ZERO_COPY,
480 RASTER_WORKER_POOL_TYPE_ONE_COPY, 480 RASTER_WORKER_POOL_TYPE_ONE_COPY,
481 RASTER_WORKER_POOL_TYPE_GPU, 481 RASTER_WORKER_POOL_TYPE_GPU,
482 RASTER_WORKER_POOL_TYPE_BITMAP)); 482 RASTER_WORKER_POOL_TYPE_BITMAP));
483 483
484 class RasterWorkerPoolCommonPerfTest : public RasterWorkerPoolPerfTestBase, 484 class RasterWorkerPoolCommonPerfTest : public RasterWorkerPoolPerfTestBase,
485 public testing::Test { 485 public testing::Test {
486 public: 486 public:
487 // Overridden from testing::Test: 487 // Overridden from testing::Test:
488 virtual void SetUp() override { 488 void SetUp() override {
489 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); 489 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass();
490 CHECK(output_surface_->BindToClient(&output_surface_client_)); 490 CHECK(output_surface_->BindToClient(&output_surface_client_));
491 resource_provider_ = 491 resource_provider_ =
492 ResourceProvider::Create( 492 ResourceProvider::Create(
493 output_surface_.get(), NULL, NULL, NULL, 0, false, 1).Pass(); 493 output_surface_.get(), NULL, NULL, NULL, 0, false, 1).Pass();
494 } 494 }
495 495
496 void RunBuildRasterTaskQueueTest(const std::string& test_name, 496 void RunBuildRasterTaskQueueTest(const std::string& test_name,
497 unsigned num_raster_tasks, 497 unsigned num_raster_tasks,
498 unsigned num_image_decode_tasks) { 498 unsigned num_image_decode_tasks) {
(...skipping 25 matching lines...) Expand all
524 RunBuildRasterTaskQueueTest("1_0", 1, 0); 524 RunBuildRasterTaskQueueTest("1_0", 1, 0);
525 RunBuildRasterTaskQueueTest("32_0", 32, 0); 525 RunBuildRasterTaskQueueTest("32_0", 32, 0);
526 RunBuildRasterTaskQueueTest("1_1", 1, 1); 526 RunBuildRasterTaskQueueTest("1_1", 1, 1);
527 RunBuildRasterTaskQueueTest("32_1", 32, 1); 527 RunBuildRasterTaskQueueTest("32_1", 32, 1);
528 RunBuildRasterTaskQueueTest("1_4", 1, 4); 528 RunBuildRasterTaskQueueTest("1_4", 1, 4);
529 RunBuildRasterTaskQueueTest("32_4", 32, 4); 529 RunBuildRasterTaskQueueTest("32_4", 32, 4);
530 } 530 }
531 531
532 } // namespace 532 } // namespace
533 } // namespace cc 533 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_pile_unittest.cc ('k') | cc/resources/raster_worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698