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 19 matching lines...) Expand all Loading... |
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 RasterSource* raster_source, | 38 void Playback(const RasterSource* raster_source, |
39 const gfx::Rect& rect, | 39 const gfx::Rect& rect, |
40 float scale, | 40 float scale) override { |
41 RenderingStatsInstrumentation* stats) override { | |
42 if (!memory_) | 41 if (!memory_) |
43 return; | 42 return; |
44 | 43 |
45 RasterWorkerPool::PlaybackToMemory(memory_, | 44 RasterWorkerPool::PlaybackToMemory(memory_, |
46 resource_->format(), | 45 resource_->format(), |
47 resource_->size(), | 46 resource_->size(), |
48 stride_, | 47 stride_, |
49 raster_source, | 48 raster_source, |
50 rect, | 49 rect, |
51 scale, | 50 scale); |
52 stats); | |
53 } | 51 } |
54 | 52 |
55 private: | 53 private: |
56 ResourceProvider* resource_provider_; | 54 ResourceProvider* resource_provider_; |
57 const Resource* resource_; | 55 const Resource* resource_; |
58 uint8_t* memory_; | 56 uint8_t* memory_; |
59 int stride_; | 57 int stride_; |
60 | 58 |
61 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl); | 59 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl); |
62 }; | 60 }; |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( | 744 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( |
747 base::debug::TracedValue* throttle_state) const { | 745 base::debug::TracedValue* throttle_state) const { |
748 throttle_state->SetInteger("bytes_available_for_upload", | 746 throttle_state->SetInteger("bytes_available_for_upload", |
749 max_bytes_pending_upload_ - bytes_pending_upload_); | 747 max_bytes_pending_upload_ - bytes_pending_upload_); |
750 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 748 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
751 throttle_state->SetInteger("scheduled_raster_task_count", | 749 throttle_state->SetInteger("scheduled_raster_task_count", |
752 scheduled_raster_task_count_); | 750 scheduled_raster_task_count_); |
753 } | 751 } |
754 | 752 |
755 } // namespace cc | 753 } // namespace cc |
OLD | NEW |