OLD | NEW |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 virtual Capabilities ContextCapabilities() override { | 70 virtual Capabilities ContextCapabilities() override { |
71 Capabilities capabilities; | 71 Capabilities capabilities; |
72 capabilities.gpu.image = true; | 72 capabilities.gpu.image = true; |
73 capabilities.gpu.sync_query = true; | 73 capabilities.gpu.sync_query = true; |
74 return capabilities; | 74 return capabilities; |
75 } | 75 } |
76 virtual gpu::gles2::GLES2Interface* ContextGL() override { | 76 virtual gpu::gles2::GLES2Interface* ContextGL() override { |
77 return context_gl_.get(); | 77 return context_gl_.get(); |
78 } | 78 } |
79 virtual gpu::ContextSupport* ContextSupport() override { return &support_; } | 79 virtual gpu::ContextSupport* ContextSupport() override { return &support_; } |
80 virtual class GrContext* GrContext() override { return NULL; } | 80 virtual class GrContext* GrContext() override { return nullptr; } |
81 virtual bool IsContextLost() override { return false; } | 81 virtual bool IsContextLost() override { return false; } |
82 virtual void VerifyContexts() override {} | 82 virtual void VerifyContexts() override {} |
83 virtual void DeleteCachedResources() override {} | 83 virtual void DeleteCachedResources() override {} |
84 virtual bool DestroyedOnMainThread() override { return false; } | 84 virtual bool DestroyedOnMainThread() override { return false; } |
85 virtual void SetLostContextCallback(const LostContextCallback& cb) override {} | 85 virtual void SetLostContextCallback(const LostContextCallback& cb) override {} |
86 virtual void SetMemoryPolicyChangedCallback( | 86 virtual void SetMemoryPolicyChangedCallback( |
87 const MemoryPolicyChangedCallback& cb) override {} | 87 const MemoryPolicyChangedCallback& cb) override {} |
88 | 88 |
89 private: | 89 private: |
90 virtual ~PerfContextProvider() {} | 90 virtual ~PerfContextProvider() {} |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 "runs/s", | 394 "runs/s", |
395 true); | 395 true); |
396 } | 396 } |
397 | 397 |
398 private: | 398 private: |
399 void Create3dOutputSurfaceAndResourceProvider() { | 399 void Create3dOutputSurfaceAndResourceProvider() { |
400 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); | 400 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); |
401 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 401 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
402 resource_provider_ = | 402 resource_provider_ = |
403 ResourceProvider::Create( | 403 ResourceProvider::Create( |
404 output_surface_.get(), NULL, NULL, 0, false, 1, false).Pass(); | 404 output_surface_.get(), nullptr, nullptr, 0, false, 1, false).Pass(); |
405 } | 405 } |
406 | 406 |
407 void CreateSoftwareOutputSurfaceAndResourceProvider() { | 407 void CreateSoftwareOutputSurfaceAndResourceProvider() { |
408 output_surface_ = FakeOutputSurface::CreateSoftware( | 408 output_surface_ = FakeOutputSurface::CreateSoftware( |
409 make_scoped_ptr(new SoftwareOutputDevice)); | 409 make_scoped_ptr(new SoftwareOutputDevice)); |
410 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 410 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
411 resource_provider_ = ResourceProvider::Create(output_surface_.get(), | 411 resource_provider_ = ResourceProvider::Create(output_surface_.get(), |
412 &shared_bitmap_manager_, | 412 &shared_bitmap_manager_, |
413 NULL, | 413 nullptr, |
414 0, | 414 0, |
415 false, | 415 false, |
416 1, | 416 1, |
417 false).Pass(); | 417 false).Pass(); |
418 } | 418 } |
419 | 419 |
420 std::string TestModifierString() const { | 420 std::string TestModifierString() const { |
421 switch (GetParam()) { | 421 switch (GetParam()) { |
422 case RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER: | 422 case RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER: |
423 return std::string("_pixel_raster_worker_pool"); | 423 return std::string("_pixel_raster_worker_pool"); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 476 |
477 class RasterWorkerPoolCommonPerfTest : public RasterWorkerPoolPerfTestBase, | 477 class RasterWorkerPoolCommonPerfTest : public RasterWorkerPoolPerfTestBase, |
478 public testing::Test { | 478 public testing::Test { |
479 public: | 479 public: |
480 // Overridden from testing::Test: | 480 // Overridden from testing::Test: |
481 virtual void SetUp() override { | 481 virtual void SetUp() override { |
482 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); | 482 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); |
483 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 483 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
484 resource_provider_ = | 484 resource_provider_ = |
485 ResourceProvider::Create( | 485 ResourceProvider::Create( |
486 output_surface_.get(), NULL, NULL, 0, false, 1, false).Pass(); | 486 output_surface_.get(), nullptr, nullptr, 0, false, 1, false).Pass(); |
487 } | 487 } |
488 | 488 |
489 void RunBuildRasterTaskQueueTest(const std::string& test_name, | 489 void RunBuildRasterTaskQueueTest(const std::string& test_name, |
490 unsigned num_raster_tasks, | 490 unsigned num_raster_tasks, |
491 unsigned num_image_decode_tasks) { | 491 unsigned num_image_decode_tasks) { |
492 ImageDecodeTask::Vector image_decode_tasks; | 492 ImageDecodeTask::Vector image_decode_tasks; |
493 RasterTaskVector raster_tasks; | 493 RasterTaskVector raster_tasks; |
494 CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks); | 494 CreateImageDecodeTasks(num_image_decode_tasks, &image_decode_tasks); |
495 CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks); | 495 CreateRasterTasks(num_raster_tasks, image_decode_tasks, &raster_tasks); |
496 | 496 |
(...skipping 20 matching lines...) Expand all Loading... |
517 RunBuildRasterTaskQueueTest("1_0", 1, 0); | 517 RunBuildRasterTaskQueueTest("1_0", 1, 0); |
518 RunBuildRasterTaskQueueTest("32_0", 32, 0); | 518 RunBuildRasterTaskQueueTest("32_0", 32, 0); |
519 RunBuildRasterTaskQueueTest("1_1", 1, 1); | 519 RunBuildRasterTaskQueueTest("1_1", 1, 1); |
520 RunBuildRasterTaskQueueTest("32_1", 32, 1); | 520 RunBuildRasterTaskQueueTest("32_1", 32, 1); |
521 RunBuildRasterTaskQueueTest("1_4", 1, 4); | 521 RunBuildRasterTaskQueueTest("1_4", 1, 4); |
522 RunBuildRasterTaskQueueTest("32_4", 32, 4); | 522 RunBuildRasterTaskQueueTest("32_4", 32, 4); |
523 } | 523 } |
524 | 524 |
525 } // namespace | 525 } // namespace |
526 } // namespace cc | 526 } // namespace cc |
OLD | NEW |