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/display_list_recording_source.h" | 5 #include "cc/resources/display_list_recording_source.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "cc/base/histograms.h" | 9 #include "cc/base/histograms.h" |
10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 int repeat_count = 1; | 113 int repeat_count = 1; |
114 if (slow_down_raster_scale_factor_for_debug_ > 1) { | 114 if (slow_down_raster_scale_factor_for_debug_ > 1) { |
115 repeat_count = slow_down_raster_scale_factor_for_debug_; | 115 repeat_count = slow_down_raster_scale_factor_for_debug_; |
116 if (painting_control != | 116 if (painting_control != |
117 ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED) { | 117 ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED) { |
118 painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED; | 118 painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED; |
119 } | 119 } |
120 } | 120 } |
121 for (int i = 0; i < repeat_count; ++i) { | 121 for (int i = 0; i < repeat_count; ++i) { |
122 display_list_ = painter->PaintContentsToDisplayList(recorded_viewport_, | 122 const bool use_cached_picture = true; |
123 painting_control); | 123 display_list_ = |
| 124 DisplayItemList::Create(recorded_viewport_, use_cached_picture); |
| 125 painter->PaintContentsToDisplayList(display_list_.get(), recorded_viewport_, |
| 126 painting_control); |
124 } | 127 } |
125 display_list_->set_layer_rect(recorded_viewport_); | 128 display_list_->CreateAndCacheSkPicture(); |
| 129 |
126 is_suitable_for_gpu_rasterization_ = | 130 is_suitable_for_gpu_rasterization_ = |
127 display_list_->IsSuitableForGpuRasterization(); | 131 display_list_->IsSuitableForGpuRasterization(); |
128 | |
129 DetermineIfSolidColor(); | 132 DetermineIfSolidColor(); |
130 display_list_->EmitTraceSnapshot(); | 133 display_list_->EmitTraceSnapshot(); |
131 | |
132 display_list_->CreateAndCacheSkPicture(); | |
133 if (gather_pixel_refs_) | 134 if (gather_pixel_refs_) |
134 display_list_->GatherPixelRefs(grid_cell_size_); | 135 display_list_->GatherPixelRefs(grid_cell_size_); |
135 | 136 |
136 return true; | 137 return true; |
137 } | 138 } |
138 | 139 |
139 gfx::Size DisplayListRecordingSource::GetSize() const { | 140 gfx::Size DisplayListRecordingSource::GetSize() const { |
140 return size_; | 141 return size_; |
141 } | 142 } |
142 | 143 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 195 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
195 } | 196 } |
196 | 197 |
197 void DisplayListRecordingSource::Clear() { | 198 void DisplayListRecordingSource::Clear() { |
198 recorded_viewport_ = gfx::Rect(); | 199 recorded_viewport_ = gfx::Rect(); |
199 display_list_ = NULL; | 200 display_list_ = NULL; |
200 is_solid_color_ = false; | 201 is_solid_color_ = false; |
201 } | 202 } |
202 | 203 |
203 } // namespace cc | 204 } // namespace cc |
OLD | NEW |