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/raster/tile_task_worker_pool.h" | 5 #include "cc/raster/tile_task_worker_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 tile_task_worker_pool_->AsTileTaskRunner()->CheckForCompletedTasks(); | 187 tile_task_worker_pool_->AsTileTaskRunner()->CheckForCompletedTasks(); |
188 } | 188 } |
189 | 189 |
190 void ScheduleTasks() { | 190 void ScheduleTasks() { |
191 graph_.Reset(); | 191 graph_.Reset(); |
192 | 192 |
193 size_t priority = 0; | 193 size_t priority = 0; |
194 | 194 |
195 for (RasterTaskVector::const_iterator it = tasks_.begin(); | 195 for (RasterTaskVector::const_iterator it = tasks_.begin(); |
196 it != tasks_.end(); ++it) { | 196 it != tasks_.end(); ++it) { |
197 graph_.nodes.emplace_back(it->get(), 0 /* group */, priority++, | 197 graph_.nodes.emplace_back(it->get(), priority++, 0 /* dependencies */); |
198 0 /* dependencies */); | |
199 } | 198 } |
200 | 199 |
201 tile_task_worker_pool_->AsTileTaskRunner()->ScheduleTasks(&graph_); | 200 tile_task_worker_pool_->AsTileTaskRunner()->ScheduleTasks(&graph_); |
202 } | 201 } |
203 | 202 |
204 void AppendTask(unsigned id, const gfx::Size& size) { | 203 void AppendTask(unsigned id, const gfx::Size& size) { |
205 scoped_ptr<ScopedResource> resource( | 204 scoped_ptr<ScopedResource> resource( |
206 ScopedResource::Create(resource_provider_.get())); | 205 ScopedResource::Create(resource_provider_.get())); |
207 resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, | 206 resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, |
208 RGBA_8888); | 207 RGBA_8888); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 368 |
370 INSTANTIATE_TEST_CASE_P(TileTaskWorkerPoolTests, | 369 INSTANTIATE_TEST_CASE_P(TileTaskWorkerPoolTests, |
371 TileTaskWorkerPoolTest, | 370 TileTaskWorkerPoolTest, |
372 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, | 371 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, |
373 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, | 372 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, |
374 TILE_TASK_WORKER_POOL_TYPE_GPU, | 373 TILE_TASK_WORKER_POOL_TYPE_GPU, |
375 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); | 374 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); |
376 | 375 |
377 } // namespace | 376 } // namespace |
378 } // namespace cc | 377 } // namespace cc |
OLD | NEW |