| 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 "cc/debug/traced_value.h" | 8 #include "cc/debug/traced_value.h" |
| 9 #include "cc/resources/resource.h" | 9 #include "cc/resources/resource.h" |
| 10 | 10 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 SkCanvas* ImageRasterWorkerPool::AcquireCanvasForRaster(RasterTask* task) { | 148 SkCanvas* ImageRasterWorkerPool::AcquireCanvasForRaster(RasterTask* task) { |
| 149 return resource_provider_->MapImageRasterBuffer(task->resource()->id()); | 149 return resource_provider_->MapImageRasterBuffer(task->resource()->id()); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void ImageRasterWorkerPool::ReleaseCanvasForRaster(RasterTask* task) { | 152 void ImageRasterWorkerPool::ReleaseCanvasForRaster(RasterTask* task) { |
| 153 resource_provider_->UnmapImageRasterBuffer(task->resource()->id()); | 153 resource_provider_->UnmapImageRasterBuffer(task->resource()->id()); |
| 154 | 154 |
| 155 // Map/UnmapImageRasterBuffer provides direct access to the memory used by the | 155 // Map/UnmapImageRasterBuffer provides direct access to the memory used by the |
| 156 // GPU. Read lock fences are required to ensure that we're not trying to map a | 156 // GPU. Read lock fences are required to ensure that we're not trying to map a |
| 157 // resource that is currently in-use by the GPU. | 157 // resource that is currently in-use by the GPU. |
| 158 resource_provider_->EnableReadLockFences(task->resource()->id(), true); | 158 resource_provider_->EnableReadLockFences(task->resource()->id()); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void ImageRasterWorkerPool::OnRasterFinished() { | 161 void ImageRasterWorkerPool::OnRasterFinished() { |
| 162 TRACE_EVENT0("cc", "ImageRasterWorkerPool::OnRasterFinished"); | 162 TRACE_EVENT0("cc", "ImageRasterWorkerPool::OnRasterFinished"); |
| 163 | 163 |
| 164 DCHECK(raster_tasks_pending_); | 164 DCHECK(raster_tasks_pending_); |
| 165 raster_tasks_pending_ = false; | 165 raster_tasks_pending_ = false; |
| 166 TRACE_EVENT_ASYNC_END0("cc", "ScheduledTasks", this); | 166 TRACE_EVENT_ASYNC_END0("cc", "ScheduledTasks", this); |
| 167 client_->DidFinishRunningTasks(); | 167 client_->DidFinishRunningTasks(); |
| 168 } | 168 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 185 | 185 |
| 186 scoped_ptr<base::Value> ImageRasterWorkerPool::StateAsValue() const { | 186 scoped_ptr<base::Value> ImageRasterWorkerPool::StateAsValue() const { |
| 187 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue); | 187 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue); |
| 188 | 188 |
| 189 state->SetBoolean("tasks_required_for_activation_pending", | 189 state->SetBoolean("tasks_required_for_activation_pending", |
| 190 raster_tasks_required_for_activation_pending_); | 190 raster_tasks_required_for_activation_pending_); |
| 191 return state.PassAs<base::Value>(); | 191 return state.PassAs<base::Value>(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace cc | 194 } // namespace cc |
| OLD | NEW |