| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/pixel_buffer_raster_worker_pool.h" | 5 #include "cc/resources/pixel_buffer_raster_worker_pool.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/containers/stack_container.h" | 9 #include "base/containers/stack_container.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 stride_(0) { | 28 stride_(0) { |
| 29 resource_provider_->AcquirePixelBuffer(resource_->id()); | 29 resource_provider_->AcquirePixelBuffer(resource_->id()); |
| 30 memory_ = resource_provider_->MapPixelBuffer(resource_->id(), &stride_); | 30 memory_ = resource_provider_->MapPixelBuffer(resource_->id(), &stride_); |
| 31 } | 31 } |
| 32 | 32 |
| 33 ~RasterBufferImpl() override { | 33 ~RasterBufferImpl() override { |
| 34 resource_provider_->ReleasePixelBuffer(resource_->id()); | 34 resource_provider_->ReleasePixelBuffer(resource_->id()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // Overridden from RasterBuffer: | 37 // Overridden from RasterBuffer: |
| 38 void Playback(const PicturePileImpl* picture_pile, | 38 void Playback(const RasterSource* raster_source, |
| 39 const gfx::Rect& rect, | 39 const gfx::Rect& rect, |
| 40 float scale, | 40 float scale, |
| 41 RenderingStatsInstrumentation* stats) override { | 41 RenderingStatsInstrumentation* stats) override { |
| 42 if (!memory_) | 42 if (!memory_) |
| 43 return; | 43 return; |
| 44 | 44 |
| 45 RasterWorkerPool::PlaybackToMemory(memory_, | 45 RasterWorkerPool::PlaybackToMemory(memory_, |
| 46 resource_->format(), | 46 resource_->format(), |
| 47 resource_->size(), | 47 resource_->size(), |
| 48 stride_, | 48 stride_, |
| 49 picture_pile, | 49 raster_source, |
| 50 rect, | 50 rect, |
| 51 scale, | 51 scale, |
| 52 stats); | 52 stats); |
| 53 } | 53 } |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 ResourceProvider* resource_provider_; | 56 ResourceProvider* resource_provider_; |
| 57 const Resource* resource_; | 57 const Resource* resource_; |
| 58 uint8_t* memory_; | 58 uint8_t* memory_; |
| 59 int stride_; | 59 int stride_; |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( | 746 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( |
| 747 base::debug::TracedValue* throttle_state) const { | 747 base::debug::TracedValue* throttle_state) const { |
| 748 throttle_state->SetInteger("bytes_available_for_upload", | 748 throttle_state->SetInteger("bytes_available_for_upload", |
| 749 max_bytes_pending_upload_ - bytes_pending_upload_); | 749 max_bytes_pending_upload_ - bytes_pending_upload_); |
| 750 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 750 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
| 751 throttle_state->SetInteger("scheduled_raster_task_count", | 751 throttle_state->SetInteger("scheduled_raster_task_count", |
| 752 scheduled_raster_task_count_); | 752 scheduled_raster_task_count_); |
| 753 } | 753 } |
| 754 | 754 |
| 755 } // namespace cc | 755 } // namespace cc |
| OLD | NEW |