| 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/raster/one_copy_tile_task_worker_pool.h" | 5 #include "cc/raster/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 24 matching lines...) Expand all Loading... |
| 35 const Resource* resource, | 35 const Resource* resource, |
| 36 uint64_t previous_content_id) | 36 uint64_t previous_content_id) |
| 37 : worker_pool_(worker_pool), | 37 : worker_pool_(worker_pool), |
| 38 resource_(resource), | 38 resource_(resource), |
| 39 lock_(resource_provider, resource->id()), | 39 lock_(resource_provider, resource->id()), |
| 40 previous_content_id_(previous_content_id) {} | 40 previous_content_id_(previous_content_id) {} |
| 41 | 41 |
| 42 ~RasterBufferImpl() override {} | 42 ~RasterBufferImpl() override {} |
| 43 | 43 |
| 44 // Overridden from RasterBuffer: | 44 // Overridden from RasterBuffer: |
| 45 void Playback(const RasterSource* raster_source, | 45 void Playback(const DisplayListRasterSource* raster_source, |
| 46 const gfx::Rect& raster_full_rect, | 46 const gfx::Rect& raster_full_rect, |
| 47 const gfx::Rect& raster_dirty_rect, | 47 const gfx::Rect& raster_dirty_rect, |
| 48 uint64_t new_content_id, | 48 uint64_t new_content_id, |
| 49 float scale, | 49 float scale, |
| 50 bool include_images) override { | 50 bool include_images) override { |
| 51 worker_pool_->PlaybackAndCopyOnWorkerThread( | 51 worker_pool_->PlaybackAndCopyOnWorkerThread( |
| 52 resource_, &lock_, raster_source, raster_full_rect, raster_dirty_rect, | 52 resource_, &lock_, raster_source, raster_full_rect, raster_dirty_rect, |
| 53 scale, include_images, previous_content_id_, new_content_id); | 53 scale, include_images, previous_content_id_, new_content_id); |
| 54 } | 54 } |
| 55 | 55 |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 } | 360 } |
| 361 | 361 |
| 362 void OneCopyTileTaskWorkerPool::ReleaseBufferForRaster( | 362 void OneCopyTileTaskWorkerPool::ReleaseBufferForRaster( |
| 363 scoped_ptr<RasterBuffer> buffer) { | 363 scoped_ptr<RasterBuffer> buffer) { |
| 364 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. | 364 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. |
| 365 } | 365 } |
| 366 | 366 |
| 367 void OneCopyTileTaskWorkerPool::PlaybackAndCopyOnWorkerThread( | 367 void OneCopyTileTaskWorkerPool::PlaybackAndCopyOnWorkerThread( |
| 368 const Resource* resource, | 368 const Resource* resource, |
| 369 const ResourceProvider::ScopedWriteLockGL* resource_lock, | 369 const ResourceProvider::ScopedWriteLockGL* resource_lock, |
| 370 const RasterSource* raster_source, | 370 const DisplayListRasterSource* raster_source, |
| 371 const gfx::Rect& raster_full_rect, | 371 const gfx::Rect& raster_full_rect, |
| 372 const gfx::Rect& raster_dirty_rect, | 372 const gfx::Rect& raster_dirty_rect, |
| 373 float scale, | 373 float scale, |
| 374 bool include_images, | 374 bool include_images, |
| 375 uint64_t previous_content_id, | 375 uint64_t previous_content_id, |
| 376 uint64_t new_content_id) { | 376 uint64_t new_content_id) { |
| 377 base::AutoLock lock(lock_); | 377 base::AutoLock lock(lock_); |
| 378 | 378 |
| 379 scoped_ptr<StagingBuffer> staging_buffer = | 379 scoped_ptr<StagingBuffer> staging_buffer = |
| 380 AcquireStagingBuffer(resource, previous_content_id); | 380 AcquireStagingBuffer(resource, previous_content_id); |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 | 811 |
| 812 staging_state->SetInteger("staging_buffer_count", | 812 staging_state->SetInteger("staging_buffer_count", |
| 813 static_cast<int>(buffers_.size())); | 813 static_cast<int>(buffers_.size())); |
| 814 staging_state->SetInteger("busy_count", | 814 staging_state->SetInteger("busy_count", |
| 815 static_cast<int>(busy_buffers_.size())); | 815 static_cast<int>(busy_buffers_.size())); |
| 816 staging_state->SetInteger("free_count", | 816 staging_state->SetInteger("free_count", |
| 817 static_cast<int>(free_buffers_.size())); | 817 static_cast<int>(free_buffers_.size())); |
| 818 } | 818 } |
| 819 | 819 |
| 820 } // namespace cc | 820 } // namespace cc |
| OLD | NEW |