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/direct_raster_worker_pool.h" | 5 #include "cc/resources/direct_raster_worker_pool.h" |
6 | 6 |
7 #include "cc/output/context_provider.h" | 7 #include "cc/output/context_provider.h" |
8 #include "cc/resources/resource.h" | 8 #include "cc/resources/resource.h" |
9 #include "cc/resources/resource_provider.h" | 9 #include "cc/resources/resource_provider.h" |
10 #include "gpu/command_buffer/client/gles2_interface.h" | 10 #include "gpu/command_buffer/client/gles2_interface.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 it != completed_tasks_.end(); | 97 it != completed_tasks_.end(); |
98 ++it) { | 98 ++it) { |
99 internal::WorkerPoolTask* task = it->get(); | 99 internal::WorkerPoolTask* task = it->get(); |
100 | 100 |
101 task->RunReplyOnOriginThread(); | 101 task->RunReplyOnOriginThread(); |
102 } | 102 } |
103 completed_tasks_.clear(); | 103 completed_tasks_.clear(); |
104 } | 104 } |
105 | 105 |
106 SkCanvas* DirectRasterWorkerPool::AcquireCanvasForRaster( | 106 SkCanvas* DirectRasterWorkerPool::AcquireCanvasForRaster( |
107 internal::WorkerPoolTask* task, | 107 internal::RasterWorkerPoolTask* task) { |
108 const Resource* resource) { | 108 return resource_provider()->MapDirectRasterBuffer(task->resource()->id()); |
109 return resource_provider()->MapDirectRasterBuffer(resource->id()); | |
110 } | 109 } |
111 | 110 |
112 void DirectRasterWorkerPool::ReleaseCanvasForRaster( | 111 void DirectRasterWorkerPool::OnRasterCompleted( |
113 internal::WorkerPoolTask* task, | 112 internal::RasterWorkerPoolTask* task, |
114 const Resource* resource) { | 113 const PicturePileImpl::Analysis& analysis) { |
115 resource_provider()->UnmapDirectRasterBuffer(resource->id()); | 114 resource_provider()->UnmapDirectRasterBuffer(task->resource()->id()); |
116 } | 115 } |
117 | 116 |
118 void DirectRasterWorkerPool::OnRasterTasksFinished() { | 117 void DirectRasterWorkerPool::OnRasterTasksFinished() { |
119 DCHECK(raster_tasks_pending_); | 118 DCHECK(raster_tasks_pending_); |
120 raster_tasks_pending_ = false; | 119 raster_tasks_pending_ = false; |
121 client()->DidFinishRunningTasks(); | 120 client()->DidFinishRunningTasks(); |
122 } | 121 } |
123 | 122 |
124 void DirectRasterWorkerPool::OnRasterTasksRequiredForActivationFinished() { | 123 void DirectRasterWorkerPool::OnRasterTasksRequiredForActivationFinished() { |
125 DCHECK(raster_tasks_required_for_activation_pending_); | 124 DCHECK(raster_tasks_required_for_activation_pending_); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // TODO(alokp): Implement TestContextProvider::GrContext(). | 177 // TODO(alokp): Implement TestContextProvider::GrContext(). |
179 if (gr_context) | 178 if (gr_context) |
180 gr_context->flush(); | 179 gr_context->flush(); |
181 } | 180 } |
182 | 181 |
183 RunTaskOnOriginThread(raster_required_for_activation_finished_task()); | 182 RunTaskOnOriginThread(raster_required_for_activation_finished_task()); |
184 RunTaskOnOriginThread(raster_finished_task()); | 183 RunTaskOnOriginThread(raster_finished_task()); |
185 } | 184 } |
186 | 185 |
187 } // namespace cc | 186 } // namespace cc |
OLD | NEW |