| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 : context_provider_(make_scoped_refptr(new PerfContextProvider)), | 151 : context_provider_(make_scoped_refptr(new PerfContextProvider)), |
| 152 task_runner_(new base::TestSimpleTaskRunner), | 152 task_runner_(new base::TestSimpleTaskRunner), |
| 153 task_graph_runner_(new TaskGraphRunner), | 153 task_graph_runner_(new TaskGraphRunner), |
| 154 timer_(kWarmupRuns, | 154 timer_(kWarmupRuns, |
| 155 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 155 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
| 156 kTimeCheckInterval) { | 156 kTimeCheckInterval) { |
| 157 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); | 157 output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass(); |
| 158 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 158 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
| 159 | 159 |
| 160 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); | 160 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); |
| 161 resource_provider_ = | 161 resource_provider_ = ResourceProvider::Create(output_surface_.get(), |
| 162 ResourceProvider::Create( | 162 shared_bitmap_manager_.get(), |
| 163 output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1, | 163 NULL, |
| 164 false).Pass(); | 164 0, |
| 165 false, |
| 166 1, |
| 167 false).Pass(); |
| 165 staging_resource_pool_ = ResourcePool::Create( | 168 staging_resource_pool_ = ResourcePool::Create( |
| 166 resource_provider_.get(), GL_TEXTURE_2D, RGBA_8888); | 169 resource_provider_.get(), GL_TEXTURE_2D, RGBA_8888); |
| 167 } | 170 } |
| 168 | 171 |
| 169 void CreateImageDecodeTasks(unsigned num_image_decode_tasks, | 172 void CreateImageDecodeTasks(unsigned num_image_decode_tasks, |
| 170 ImageDecodeTask::Vector* image_decode_tasks) { | 173 ImageDecodeTask::Vector* image_decode_tasks) { |
| 171 for (unsigned i = 0; i < num_image_decode_tasks; ++i) | 174 for (unsigned i = 0; i < num_image_decode_tasks; ++i) |
| 172 image_decode_tasks->push_back(new PerfImageDecodeTaskImpl); | 175 image_decode_tasks->push_back(new PerfImageDecodeTaskImpl); |
| 173 } | 176 } |
| 174 | 177 |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 RunBuildRasterTaskQueueTest("1_0", 1, 0); | 465 RunBuildRasterTaskQueueTest("1_0", 1, 0); |
| 463 RunBuildRasterTaskQueueTest("32_0", 32, 0); | 466 RunBuildRasterTaskQueueTest("32_0", 32, 0); |
| 464 RunBuildRasterTaskQueueTest("1_1", 1, 1); | 467 RunBuildRasterTaskQueueTest("1_1", 1, 1); |
| 465 RunBuildRasterTaskQueueTest("32_1", 32, 1); | 468 RunBuildRasterTaskQueueTest("32_1", 32, 1); |
| 466 RunBuildRasterTaskQueueTest("1_4", 1, 4); | 469 RunBuildRasterTaskQueueTest("1_4", 1, 4); |
| 467 RunBuildRasterTaskQueueTest("32_4", 32, 4); | 470 RunBuildRasterTaskQueueTest("32_4", 32, 4); |
| 468 } | 471 } |
| 469 | 472 |
| 470 } // namespace | 473 } // namespace |
| 471 } // namespace cc | 474 } // namespace cc |
| OLD | NEW |