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/raster/bitmap_tile_task_worker_pool.h" | 5 #include "cc/raster/bitmap_tile_task_worker_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
11 #include "base/trace_event/trace_event_argument.h" | 11 #include "base/trace_event/trace_event_argument.h" |
12 #include "cc/debug/traced_value.h" | 12 #include "cc/debug/traced_value.h" |
13 #include "cc/playback/raster_source.h" | 13 #include "cc/playback/display_list_raster_source.h" |
14 #include "cc/raster/raster_buffer.h" | 14 #include "cc/raster/raster_buffer.h" |
15 #include "cc/resources/platform_color.h" | 15 #include "cc/resources/platform_color.h" |
16 #include "cc/resources/resource.h" | 16 #include "cc/resources/resource.h" |
17 | 17 |
18 namespace cc { | 18 namespace cc { |
19 namespace { | 19 namespace { |
20 | 20 |
21 class RasterBufferImpl : public RasterBuffer { | 21 class RasterBufferImpl : public RasterBuffer { |
22 public: | 22 public: |
23 RasterBufferImpl(ResourceProvider* resource_provider, | 23 RasterBufferImpl(ResourceProvider* resource_provider, |
24 const Resource* resource, | 24 const Resource* resource, |
25 uint64_t resource_content_id, | 25 uint64_t resource_content_id, |
26 uint64_t previous_content_id) | 26 uint64_t previous_content_id) |
27 : lock_(resource_provider, resource->id()), | 27 : lock_(resource_provider, resource->id()), |
28 resource_(resource), | 28 resource_(resource), |
29 resource_has_previous_content_( | 29 resource_has_previous_content_( |
30 resource_content_id && resource_content_id == previous_content_id) { | 30 resource_content_id && resource_content_id == previous_content_id) { |
31 } | 31 } |
32 | 32 |
33 // Overridden from RasterBuffer: | 33 // Overridden from RasterBuffer: |
34 void Playback(const RasterSource* raster_source, | 34 void Playback(const DisplayListRasterSource* raster_source, |
35 const gfx::Rect& raster_full_rect, | 35 const gfx::Rect& raster_full_rect, |
36 const gfx::Rect& raster_dirty_rect, | 36 const gfx::Rect& raster_dirty_rect, |
37 uint64_t new_content_id, | 37 uint64_t new_content_id, |
38 float scale, | 38 float scale, |
39 bool include_images) override { | 39 bool include_images) override { |
40 gfx::Rect playback_rect = raster_full_rect; | 40 gfx::Rect playback_rect = raster_full_rect; |
41 if (resource_has_previous_content_) { | 41 if (resource_has_previous_content_) { |
42 playback_rect.Intersect(raster_dirty_rect); | 42 playback_rect.Intersect(raster_dirty_rect); |
43 } | 43 } |
44 DCHECK(!playback_rect.IsEmpty()) | 44 DCHECK(!playback_rect.IsEmpty()) |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 new base::trace_event::TracedValue(); | 224 new base::trace_event::TracedValue(); |
225 | 225 |
226 state->BeginArray("tasks_pending"); | 226 state->BeginArray("tasks_pending"); |
227 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) | 227 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) |
228 state->AppendBoolean(tasks_pending_[task_set]); | 228 state->AppendBoolean(tasks_pending_[task_set]); |
229 state->EndArray(); | 229 state->EndArray(); |
230 return state; | 230 return state; |
231 } | 231 } |
232 | 232 |
233 } // namespace cc | 233 } // namespace cc |
OLD | NEW |