| 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_tile_task_worker_pool.h" | 5 #include "cc/resources/one_copy_tile_task_worker_pool.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 ++scheduled_copy_operation_count_; | 314 ++scheduled_copy_operation_count_; |
| 315 | 315 |
| 316 // There may be more work available, so wake up another worker thread. | 316 // There may be more work available, so wake up another worker thread. |
| 317 copy_operation_count_cv_.Signal(); | 317 copy_operation_count_cv_.Signal(); |
| 318 | 318 |
| 319 { | 319 { |
| 320 base::AutoUnlock unlock(lock_); | 320 base::AutoUnlock unlock(lock_); |
| 321 | 321 |
| 322 gfx::GpuMemoryBuffer* gpu_memory_buffer = write_lock->GetGpuMemoryBuffer(); | 322 gfx::GpuMemoryBuffer* gpu_memory_buffer = write_lock->GetGpuMemoryBuffer(); |
| 323 if (gpu_memory_buffer) { | 323 if (gpu_memory_buffer) { |
| 324 TileTaskWorkerPool::PlaybackToMemory( | 324 void* data = NULL; |
| 325 gpu_memory_buffer->Map(), src->format(), src->size(), | 325 bool rv = gpu_memory_buffer->Map(&data); |
| 326 gpu_memory_buffer->GetStride(), raster_source, rect, scale); | 326 DCHECK(rv); |
| 327 uint32 stride; |
| 328 gpu_memory_buffer->GetStride(&stride); |
| 329 TileTaskWorkerPool::PlaybackToMemory(data, src->format(), src->size(), |
| 330 stride, raster_source, rect, scale); |
| 327 gpu_memory_buffer->Unmap(); | 331 gpu_memory_buffer->Unmap(); |
| 328 } | 332 } |
| 329 } | 333 } |
| 330 | 334 |
| 331 pending_copy_operations_.push_back( | 335 pending_copy_operations_.push_back( |
| 332 make_scoped_ptr(new CopyOperation(write_lock.Pass(), src.Pass(), dst))); | 336 make_scoped_ptr(new CopyOperation(write_lock.Pass(), src.Pass(), dst))); |
| 333 | 337 |
| 334 // Acquire a sequence number for this copy operation. | 338 // Acquire a sequence number for this copy operation. |
| 335 CopySequenceNumber sequence = next_copy_operation_sequence_++; | 339 CopySequenceNumber sequence = next_copy_operation_sequence_++; |
| 336 | 340 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 resource_pool_->total_memory_usage_bytes()); | 502 resource_pool_->total_memory_usage_bytes()); |
| 499 staging_state->SetInteger("pending_copy_count", | 503 staging_state->SetInteger("pending_copy_count", |
| 500 resource_pool_->total_resource_count() - | 504 resource_pool_->total_resource_count() - |
| 501 resource_pool_->acquired_resource_count()); | 505 resource_pool_->acquired_resource_count()); |
| 502 staging_state->SetInteger("bytes_pending_copy", | 506 staging_state->SetInteger("bytes_pending_copy", |
| 503 resource_pool_->total_memory_usage_bytes() - | 507 resource_pool_->total_memory_usage_bytes() - |
| 504 resource_pool_->acquired_memory_usage_bytes()); | 508 resource_pool_->acquired_memory_usage_bytes()); |
| 505 } | 509 } |
| 506 | 510 |
| 507 } // namespace cc | 511 } // namespace cc |
| OLD | NEW |