| 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 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Return raster resource to pool so it can be used by another RasterBuffer | 48 // Return raster resource to pool so it can be used by another RasterBuffer |
| 49 // instance. | 49 // instance. |
| 50 if (raster_resource_) | 50 if (raster_resource_) |
| 51 resource_pool_->ReleaseResource(raster_resource_.Pass()); | 51 resource_pool_->ReleaseResource(raster_resource_.Pass()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 // Overridden from RasterBuffer: | 54 // Overridden from RasterBuffer: |
| 55 void Playback(const RasterSource* raster_source, | 55 void Playback(const RasterSource* raster_source, |
| 56 const gfx::Rect& rect, | 56 const gfx::Rect& rect, |
| 57 float scale, | 57 float scale) override { |
| 58 RenderingStatsInstrumentation* stats) override { | |
| 59 sequence_ = worker_pool_->PlaybackAndScheduleCopyOnWorkerThread( | 58 sequence_ = worker_pool_->PlaybackAndScheduleCopyOnWorkerThread( |
| 60 lock_.Pass(), | 59 lock_.Pass(), |
| 61 raster_resource_.Pass(), | 60 raster_resource_.Pass(), |
| 62 resource_, | 61 resource_, |
| 63 raster_source, | 62 raster_source, |
| 64 rect, | 63 rect, |
| 65 scale, | 64 scale, |
| 66 stats); | 65 stats); |
| 67 } | 66 } |
| 68 | 67 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 resource_pool_->total_memory_usage_bytes()); | 509 resource_pool_->total_memory_usage_bytes()); |
| 511 staging_state->SetInteger("pending_copy_count", | 510 staging_state->SetInteger("pending_copy_count", |
| 512 resource_pool_->total_resource_count() - | 511 resource_pool_->total_resource_count() - |
| 513 resource_pool_->acquired_resource_count()); | 512 resource_pool_->acquired_resource_count()); |
| 514 staging_state->SetInteger("bytes_pending_copy", | 513 staging_state->SetInteger("bytes_pending_copy", |
| 515 resource_pool_->total_memory_usage_bytes() - | 514 resource_pool_->total_memory_usage_bytes() - |
| 516 resource_pool_->acquired_memory_usage_bytes()); | 515 resource_pool_->acquired_memory_usage_bytes()); |
| 517 } | 516 } |
| 518 | 517 |
| 519 } // namespace cc | 518 } // namespace cc |
| OLD | NEW |