OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gpu_tile_task_worker_pool.h" | 5 #include "cc/raster/gpu_tile_task_worker_pool.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 bool must_support_alpha) const { | 159 bool must_support_alpha) const { |
160 return rasterizer_->resource_provider()->best_render_buffer_format(); | 160 return rasterizer_->resource_provider()->best_render_buffer_format(); |
161 } | 161 } |
162 | 162 |
163 bool GpuTileTaskWorkerPool::GetResourceRequiresSwizzle( | 163 bool GpuTileTaskWorkerPool::GetResourceRequiresSwizzle( |
164 bool must_support_alpha) const { | 164 bool must_support_alpha) const { |
165 // This doesn't require a swizzle because we rasterize to the correct format. | 165 // This doesn't require a swizzle because we rasterize to the correct format. |
166 return false; | 166 return false; |
167 } | 167 } |
168 | 168 |
169 void GpuTileTaskWorkerPool::CompleteTasks(const Task::Vector& tasks) { | 169 void GpuTileTaskWorkerPool::CompleteTasks(const DependencyTask::Vector& tasks) { |
170 for (auto& task : tasks) { | 170 for (auto& task : tasks) { |
171 TileTask* tile_task = static_cast<TileTask*>(task.get()); | 171 task->WillComplete(); |
172 | 172 task->CompleteOnOriginThread(this); |
173 tile_task->WillComplete(); | 173 task->DidComplete(); |
174 tile_task->CompleteOnOriginThread(this); | |
175 tile_task->DidComplete(); | |
176 } | 174 } |
177 completed_tasks_.clear(); | 175 completed_tasks_.clear(); |
178 } | 176 } |
179 | 177 |
180 scoped_ptr<RasterBuffer> GpuTileTaskWorkerPool::AcquireBufferForRaster( | 178 scoped_ptr<RasterBuffer> GpuTileTaskWorkerPool::AcquireBufferForRaster( |
181 const Resource* resource, | 179 const Resource* resource, |
182 uint64_t resource_content_id, | 180 uint64_t resource_content_id, |
183 uint64_t previous_content_id) { | 181 uint64_t previous_content_id) { |
184 return scoped_ptr<RasterBuffer>(new RasterBufferImpl( | 182 return scoped_ptr<RasterBuffer>(new RasterBufferImpl( |
185 rasterizer_.get(), resource, resource_content_id, previous_content_id)); | 183 rasterizer_.get(), resource, resource_content_id, previous_content_id)); |
186 } | 184 } |
187 | 185 |
188 void GpuTileTaskWorkerPool::ReleaseBufferForRaster( | 186 void GpuTileTaskWorkerPool::ReleaseBufferForRaster( |
189 scoped_ptr<RasterBuffer> buffer) { | 187 scoped_ptr<RasterBuffer> buffer) { |
190 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. | 188 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. |
191 } | 189 } |
192 | 190 |
193 } // namespace cc | 191 } // namespace cc |
OLD | NEW |