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/bitmap_raster_worker_pool.h" | 5 #include "cc/resources/bitmap_raster_worker_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/debug/trace_event_argument.h" | 10 #include "base/debug/trace_event_argument.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "cc/debug/traced_value.h" | 12 #include "cc/debug/traced_value.h" |
13 #include "cc/resources/picture_pile_impl.h" | 13 #include "cc/resources/picture_pile_impl.h" |
14 #include "cc/resources/raster_buffer.h" | 14 #include "cc/resources/raster_buffer.h" |
15 #include "cc/resources/resource.h" | 15 #include "cc/resources/resource.h" |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 namespace { | 18 namespace { |
19 | 19 |
20 class RasterBufferImpl : public RasterBuffer { | 20 class RasterBufferImpl : public RasterBuffer { |
21 public: | 21 public: |
22 RasterBufferImpl(ResourceProvider* resource_provider, | 22 RasterBufferImpl(ResourceProvider* resource_provider, |
23 const Resource* resource) | 23 const Resource* resource) |
24 : lock_(resource_provider, resource->id()) {} | 24 : lock_(resource_provider, resource->id()) {} |
25 | 25 |
26 // Overridden from RasterBuffer: | 26 // Overridden from RasterBuffer: |
27 virtual void Playback(const PicturePileImpl* picture_pile, | 27 void Playback(const PicturePileImpl* picture_pile, |
28 const gfx::Rect& rect, | 28 const gfx::Rect& rect, |
29 float scale, | 29 float scale, |
30 RenderingStatsInstrumentation* stats) override { | 30 RenderingStatsInstrumentation* stats) override { |
31 picture_pile->RasterToBitmap(lock_.sk_canvas(), rect, scale, stats); | 31 picture_pile->RasterToBitmap(lock_.sk_canvas(), rect, scale, stats); |
32 } | 32 } |
33 | 33 |
34 private: | 34 private: |
35 ResourceProvider::ScopedWriteLockSoftware lock_; | 35 ResourceProvider::ScopedWriteLockSoftware lock_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl); | 37 DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl); |
38 }; | 38 }; |
39 | 39 |
40 } // namespace | 40 } // namespace |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 new base::debug::TracedValue(); | 195 new base::debug::TracedValue(); |
196 | 196 |
197 state->BeginArray("tasks_pending"); | 197 state->BeginArray("tasks_pending"); |
198 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) | 198 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) |
199 state->AppendBoolean(raster_pending_[task_set]); | 199 state->AppendBoolean(raster_pending_[task_set]); |
200 state->EndArray(); | 200 state->EndArray(); |
201 return state; | 201 return state; |
202 } | 202 } |
203 | 203 |
204 } // namespace cc | 204 } // namespace cc |
OLD | NEW |