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_, resource_->format(), |
46 resource_->format(), | 45 resource_->size(), stride_, |
47 resource_->size(), | 46 raster_source, rect, scale); |
48 stride_, | |
49 raster_source, | |
50 rect, | |
51 scale, | |
52 stats); | |
53 } | 47 } |
54 | 48 |
55 private: | 49 private: |
56 ResourceProvider* resource_provider_; | 50 ResourceProvider* resource_provider_; |
57 const Resource* resource_; | 51 const Resource* resource_; |
58 uint8_t* memory_; | 52 uint8_t* memory_; |
59 int stride_; | 53 int stride_; |
60 | 54 |
61 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl); | 55 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl); |
62 }; | 56 }; |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( | 740 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( |
747 base::debug::TracedValue* throttle_state) const { | 741 base::debug::TracedValue* throttle_state) const { |
748 throttle_state->SetInteger("bytes_available_for_upload", | 742 throttle_state->SetInteger("bytes_available_for_upload", |
749 max_bytes_pending_upload_ - bytes_pending_upload_); | 743 max_bytes_pending_upload_ - bytes_pending_upload_); |
750 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 744 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
751 throttle_state->SetInteger("scheduled_raster_task_count", | 745 throttle_state->SetInteger("scheduled_raster_task_count", |
752 scheduled_raster_task_count_); | 746 scheduled_raster_task_count_); |
753 } | 747 } |
754 | 748 |
755 } // namespace cc | 749 } // namespace cc |
OLD | NEW |