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(), priority++, 0 /* dependencies */); | 197 graph_.nodes.emplace_back(it->get(), 0 /* group */, priority++, |
| 198 0 /* dependencies */); |
198 } | 199 } |
199 | 200 |
200 tile_task_worker_pool_->AsTileTaskRunner()->ScheduleTasks(&graph_); | 201 tile_task_worker_pool_->AsTileTaskRunner()->ScheduleTasks(&graph_); |
201 } | 202 } |
202 | 203 |
203 void AppendTask(unsigned id, const gfx::Size& size) { | 204 void AppendTask(unsigned id, const gfx::Size& size) { |
204 scoped_ptr<ScopedResource> resource( | 205 scoped_ptr<ScopedResource> resource( |
205 ScopedResource::Create(resource_provider_.get())); | 206 ScopedResource::Create(resource_provider_.get())); |
206 resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, | 207 resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, |
207 RGBA_8888); | 208 RGBA_8888); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 369 |
369 INSTANTIATE_TEST_CASE_P(TileTaskWorkerPoolTests, | 370 INSTANTIATE_TEST_CASE_P(TileTaskWorkerPoolTests, |
370 TileTaskWorkerPoolTest, | 371 TileTaskWorkerPoolTest, |
371 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, | 372 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, |
372 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, | 373 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, |
373 TILE_TASK_WORKER_POOL_TYPE_GPU, | 374 TILE_TASK_WORKER_POOL_TYPE_GPU, |
374 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); | 375 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); |
375 | 376 |
376 } // namespace | 377 } // namespace |
377 } // namespace cc | 378 } // namespace cc |
OLD | NEW |