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/resources/image_raster_worker_pool.h" | 5 #include "cc/resources/image_raster_worker_pool.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/debug/trace_event_argument.h" | 8 #include "base/debug/trace_event_argument.h" |
9 #include "cc/debug/traced_value.h" | 9 #include "cc/debug/traced_value.h" |
10 #include "cc/resources/resource.h" | 10 #include "cc/resources/resource.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 task->WillComplete(); | 135 task->WillComplete(); |
136 task->CompleteOnOriginThread(this); | 136 task->CompleteOnOriginThread(this); |
137 task->DidComplete(); | 137 task->DidComplete(); |
138 | 138 |
139 task->RunReplyOnOriginThread(); | 139 task->RunReplyOnOriginThread(); |
140 } | 140 } |
141 completed_tasks_.clear(); | 141 completed_tasks_.clear(); |
142 } | 142 } |
143 | 143 |
144 SkCanvas* ImageRasterWorkerPool::AcquireCanvasForRaster(RasterTask* task) { | 144 RasterBuffer* ImageRasterWorkerPool::AcquireBufferForRaster(RasterTask* task) { |
145 return resource_provider_->MapImageRasterBuffer(task->resource()->id()); | 145 return resource_provider_->AcquireImageRasterBuffer(task->resource()->id()); |
146 } | 146 } |
147 | 147 |
148 void ImageRasterWorkerPool::ReleaseCanvasForRaster(RasterTask* task) { | 148 void ImageRasterWorkerPool::ReleaseBufferForRaster(RasterTask* task) { |
149 resource_provider_->UnmapImageRasterBuffer(task->resource()->id()); | 149 resource_provider_->ReleaseImageRasterBuffer(task->resource()->id()); |
150 | 150 |
151 // Map/UnmapImageRasterBuffer provides direct access to the memory used by the | 151 // Acquire/ReleaseImageRasterBuffer provides direct access to the memory used |
152 // GPU. Read lock fences are required to ensure that we're not trying to map a | 152 // by the GPU. Read lock fences are required to ensure that we're not trying |
153 // resource that is currently in-use by the GPU. | 153 // to map a resource that is currently in-use by the GPU. |
154 resource_provider_->EnableReadLockFences(task->resource()->id()); | 154 resource_provider_->EnableReadLockFences(task->resource()->id()); |
155 } | 155 } |
156 | 156 |
157 void ImageRasterWorkerPool::OnRasterFinished() { | 157 void ImageRasterWorkerPool::OnRasterFinished() { |
158 TRACE_EVENT0("cc", "ImageRasterWorkerPool::OnRasterFinished"); | 158 TRACE_EVENT0("cc", "ImageRasterWorkerPool::OnRasterFinished"); |
159 | 159 |
160 DCHECK(raster_tasks_pending_); | 160 DCHECK(raster_tasks_pending_); |
161 raster_tasks_pending_ = false; | 161 raster_tasks_pending_ = false; |
162 TRACE_EVENT_ASYNC_END0("cc", "ScheduledTasks", this); | 162 TRACE_EVENT_ASYNC_END0("cc", "ScheduledTasks", this); |
163 client_->DidFinishRunningTasks(); | 163 client_->DidFinishRunningTasks(); |
(...skipping 14 matching lines...) Expand all Loading... |
178 ImageRasterWorkerPool::StateAsValue() const { | 178 ImageRasterWorkerPool::StateAsValue() const { |
179 scoped_refptr<base::debug::TracedValue> state = | 179 scoped_refptr<base::debug::TracedValue> state = |
180 new base::debug::TracedValue(); | 180 new base::debug::TracedValue(); |
181 | 181 |
182 state->SetBoolean("tasks_required_for_activation_pending", | 182 state->SetBoolean("tasks_required_for_activation_pending", |
183 raster_tasks_required_for_activation_pending_); | 183 raster_tasks_required_for_activation_pending_); |
184 return state; | 184 return state; |
185 } | 185 } |
186 | 186 |
187 } // namespace cc | 187 } // namespace cc |
OLD | NEW |