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/resources/gpu_raster_worker_pool.h" | 5 #include "cc/resources/gpu_raster_worker_pool.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/output/context_provider.h" | 8 #include "cc/output/context_provider.h" |
9 #include "cc/resources/resource.h" | 9 #include "cc/resources/resource.h" |
10 #include "cc/resources/resource_provider.h" | 10 #include "cc/resources/resource_provider.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 task->WillComplete(); | 142 task->WillComplete(); |
143 task->CompleteOnOriginThread(this); | 143 task->CompleteOnOriginThread(this); |
144 task->DidComplete(); | 144 task->DidComplete(); |
145 | 145 |
146 task->RunReplyOnOriginThread(); | 146 task->RunReplyOnOriginThread(); |
147 } | 147 } |
148 completed_tasks_.clear(); | 148 completed_tasks_.clear(); |
149 } | 149 } |
150 | 150 |
151 SkCanvas* GpuRasterWorkerPool::AcquireCanvasForRaster(RasterTask* task) { | 151 RasterBuffer* GpuRasterWorkerPool::AcquireBufferForRaster(RasterTask* task) { |
152 return resource_provider_->MapGpuRasterBuffer(task->resource()->id()); | 152 return resource_provider_->AcquireGpuRasterBuffer(task->resource()->id()); |
153 } | 153 } |
154 | 154 |
155 void GpuRasterWorkerPool::ReleaseCanvasForRaster(RasterTask* task) { | 155 void GpuRasterWorkerPool::ReleaseBufferForRaster(RasterTask* task) { |
156 resource_provider_->UnmapGpuRasterBuffer(task->resource()->id()); | 156 resource_provider_->ReleaseGpuRasterBuffer(task->resource()->id()); |
157 } | 157 } |
158 | 158 |
159 void GpuRasterWorkerPool::OnRasterFinished() { | 159 void GpuRasterWorkerPool::OnRasterFinished() { |
160 TRACE_EVENT0("cc", "GpuRasterWorkerPool::OnRasterFinished"); | 160 TRACE_EVENT0("cc", "GpuRasterWorkerPool::OnRasterFinished"); |
161 | 161 |
162 DCHECK(raster_tasks_pending_); | 162 DCHECK(raster_tasks_pending_); |
163 raster_tasks_pending_ = false; | 163 raster_tasks_pending_ = false; |
164 client_->DidFinishRunningTasks(); | 164 client_->DidFinishRunningTasks(); |
165 } | 165 } |
166 | 166 |
(...skipping 21 matching lines...) Expand all Loading... |
188 TRACE_EVENT0("cc", "GpuRasterWorkerPool::RunTasksOnOriginThread"); | 188 TRACE_EVENT0("cc", "GpuRasterWorkerPool::RunTasksOnOriginThread"); |
189 | 189 |
190 DCHECK(run_tasks_on_origin_thread_pending_); | 190 DCHECK(run_tasks_on_origin_thread_pending_); |
191 run_tasks_on_origin_thread_pending_ = false; | 191 run_tasks_on_origin_thread_pending_ = false; |
192 | 192 |
193 ScopedGpuRaster gpu_raster(context_provider_); | 193 ScopedGpuRaster gpu_raster(context_provider_); |
194 task_graph_runner_->RunUntilIdle(); | 194 task_graph_runner_->RunUntilIdle(); |
195 } | 195 } |
196 | 196 |
197 } // namespace cc | 197 } // namespace cc |
OLD | NEW |