Chromium Code Reviews| 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 size_t num_buffers = gpu_memory_buffer->GetNumberOfPlanes(); |
|
reveman
2015/03/23 22:24:00
This code is for contents tile textures. I don't t
emircan
2015/03/24 16:52:26
Done.
| |
| 325 gpu_memory_buffer->Map(), src->format(), src->size(), | 325 DCHECK_EQ(num_buffers, 1u); |
| 326 gpu_memory_buffer->GetStride(), raster_source, rect, scale); | 326 |
| 327 void* mapped_buffers[num_buffers]; | |
| 328 bool map_completed = gpu_memory_buffer->Map(mapped_buffers); | |
| 329 DCHECK(map_completed); | |
| 330 | |
| 331 uint32 strides[num_buffers]; | |
| 332 bool getStride_completed = gpu_memory_buffer->GetStride(strides); | |
| 333 DCHECK(getStride_completed); | |
| 334 | |
| 335 TileTaskWorkerPool::PlaybackToMemory(mapped_buffers[0], src->format(), | |
| 336 src->size(), strides[0], | |
| 337 raster_source, rect, scale); | |
| 327 gpu_memory_buffer->Unmap(); | 338 gpu_memory_buffer->Unmap(); |
| 328 } | 339 } |
| 329 } | 340 } |
| 330 | 341 |
| 331 pending_copy_operations_.push_back( | 342 pending_copy_operations_.push_back( |
| 332 make_scoped_ptr(new CopyOperation(write_lock.Pass(), src.Pass(), dst))); | 343 make_scoped_ptr(new CopyOperation(write_lock.Pass(), src.Pass(), dst))); |
| 333 | 344 |
| 334 // Acquire a sequence number for this copy operation. | 345 // Acquire a sequence number for this copy operation. |
| 335 CopySequenceNumber sequence = next_copy_operation_sequence_++; | 346 CopySequenceNumber sequence = next_copy_operation_sequence_++; |
| 336 | 347 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 498 resource_pool_->total_memory_usage_bytes()); | 509 resource_pool_->total_memory_usage_bytes()); |
| 499 staging_state->SetInteger("pending_copy_count", | 510 staging_state->SetInteger("pending_copy_count", |
| 500 resource_pool_->total_resource_count() - | 511 resource_pool_->total_resource_count() - |
| 501 resource_pool_->acquired_resource_count()); | 512 resource_pool_->acquired_resource_count()); |
| 502 staging_state->SetInteger("bytes_pending_copy", | 513 staging_state->SetInteger("bytes_pending_copy", |
| 503 resource_pool_->total_memory_usage_bytes() - | 514 resource_pool_->total_memory_usage_bytes() - |
| 504 resource_pool_->acquired_memory_usage_bytes()); | 515 resource_pool_->acquired_memory_usage_bytes()); |
| 505 } | 516 } |
| 506 | 517 |
| 507 } // namespace cc | 518 } // namespace cc |
| OLD | NEW |