| 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/one_copy_raster_worker_pool.h" | 5 #include "cc/resources/one_copy_raster_worker_pool.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/debug/trace_event_argument.h" | 10 #include "base/debug/trace_event_argument.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 task->CompleteOnOriginThread(this); | 210 task->CompleteOnOriginThread(this); |
| 211 task->DidComplete(); | 211 task->DidComplete(); |
| 212 | 212 |
| 213 task->RunReplyOnOriginThread(); | 213 task->RunReplyOnOriginThread(); |
| 214 } | 214 } |
| 215 completed_tasks_.clear(); | 215 completed_tasks_.clear(); |
| 216 | 216 |
| 217 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); | 217 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void OneCopyRasterWorkerPool::WaitForTasksToFinishRunning() { |
| 221 task_graph_runner_->WaitForTasksToFinishRunning(namespace_token_); |
| 222 } |
| 223 |
| 220 scoped_ptr<RasterBuffer> OneCopyRasterWorkerPool::AcquireBufferForRaster( | 224 scoped_ptr<RasterBuffer> OneCopyRasterWorkerPool::AcquireBufferForRaster( |
| 221 const Resource* resource) { | 225 const Resource* resource) { |
| 222 DCHECK_EQ(resource->format(), resource_pool_->resource_format()); | 226 DCHECK_EQ(resource->format(), resource_pool_->resource_format()); |
| 223 return make_scoped_ptr<RasterBuffer>( | 227 return make_scoped_ptr<RasterBuffer>( |
| 224 new RasterBufferImpl(resource_provider_, resource_pool_, resource)); | 228 new RasterBufferImpl(resource_provider_, resource_pool_, resource)); |
| 225 } | 229 } |
| 226 | 230 |
| 227 void OneCopyRasterWorkerPool::ReleaseBufferForRaster( | 231 void OneCopyRasterWorkerPool::ReleaseBufferForRaster( |
| 228 scoped_ptr<RasterBuffer> buffer) { | 232 scoped_ptr<RasterBuffer> buffer) { |
| 229 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. | 233 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 resource_pool_->total_memory_usage_bytes()); | 271 resource_pool_->total_memory_usage_bytes()); |
| 268 staging_state->SetInteger("pending_copy_count", | 272 staging_state->SetInteger("pending_copy_count", |
| 269 resource_pool_->total_resource_count() - | 273 resource_pool_->total_resource_count() - |
| 270 resource_pool_->acquired_resource_count()); | 274 resource_pool_->acquired_resource_count()); |
| 271 staging_state->SetInteger("bytes_pending_copy", | 275 staging_state->SetInteger("bytes_pending_copy", |
| 272 resource_pool_->total_memory_usage_bytes() - | 276 resource_pool_->total_memory_usage_bytes() - |
| 273 resource_pool_->acquired_memory_usage_bytes()); | 277 resource_pool_->acquired_memory_usage_bytes()); |
| 274 } | 278 } |
| 275 | 279 |
| 276 } // namespace cc | 280 } // namespace cc |
| OLD | NEW |