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/region.h" | 9 #include "cc/base/region.h" |
10 #include "cc/layers/content_layer_client.h" | 10 #include "cc/layers/content_layer_client.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // operations. | 22 // operations. |
23 const int kOpCountThatIsOkToAnalyze = 10; | 23 const int kOpCountThatIsOkToAnalyze = 10; |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 namespace cc { | 27 namespace cc { |
28 | 28 |
29 DisplayListRecordingSource::DisplayListRecordingSource() | 29 DisplayListRecordingSource::DisplayListRecordingSource() |
30 : slow_down_raster_scale_factor_for_debug_(0), | 30 : slow_down_raster_scale_factor_for_debug_(0), |
31 can_use_lcd_text_(true), | 31 can_use_lcd_text_(true), |
| 32 requires_clear_(false), |
32 is_solid_color_(false), | 33 is_solid_color_(false), |
33 solid_color_(SK_ColorTRANSPARENT), | 34 solid_color_(SK_ColorTRANSPARENT), |
| 35 background_color_(SK_ColorTRANSPARENT), |
34 pixel_record_distance_(kPixelDistanceToRecord), | 36 pixel_record_distance_(kPixelDistanceToRecord), |
35 is_suitable_for_gpu_rasterization_(true) { | 37 is_suitable_for_gpu_rasterization_(true) { |
36 } | 38 } |
37 | 39 |
38 DisplayListRecordingSource::~DisplayListRecordingSource() { | 40 DisplayListRecordingSource::~DisplayListRecordingSource() { |
39 } | 41 } |
40 | 42 |
41 bool DisplayListRecordingSource::UpdateAndExpandInvalidation( | 43 bool DisplayListRecordingSource::UpdateAndExpandInvalidation( |
42 ContentLayerClient* painter, | 44 ContentLayerClient* painter, |
43 Region* invalidation, | 45 Region* invalidation, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 129 |
128 void DisplayListRecordingSource::SetEmptyBounds() { | 130 void DisplayListRecordingSource::SetEmptyBounds() { |
129 size_ = gfx::Size(); | 131 size_ = gfx::Size(); |
130 Clear(); | 132 Clear(); |
131 } | 133 } |
132 | 134 |
133 void DisplayListRecordingSource::SetSlowdownRasterScaleFactor(int factor) { | 135 void DisplayListRecordingSource::SetSlowdownRasterScaleFactor(int factor) { |
134 slow_down_raster_scale_factor_for_debug_ = factor; | 136 slow_down_raster_scale_factor_for_debug_ = factor; |
135 } | 137 } |
136 | 138 |
| 139 void DisplayListRecordingSource::SetBackgroundColor(SkColor background_color) { |
| 140 background_color_ = background_color; |
| 141 } |
| 142 |
| 143 void DisplayListRecordingSource::SetRequiresClear(bool requires_clear) { |
| 144 requires_clear_ = requires_clear; |
| 145 } |
| 146 |
137 void DisplayListRecordingSource::SetUnsuitableForGpuRasterizationForTesting() { | 147 void DisplayListRecordingSource::SetUnsuitableForGpuRasterizationForTesting() { |
138 is_suitable_for_gpu_rasterization_ = false; | 148 is_suitable_for_gpu_rasterization_ = false; |
139 } | 149 } |
140 | 150 |
141 bool DisplayListRecordingSource::IsSuitableForGpuRasterization() const { | 151 bool DisplayListRecordingSource::IsSuitableForGpuRasterization() const { |
142 return is_suitable_for_gpu_rasterization_; | 152 return is_suitable_for_gpu_rasterization_; |
143 } | 153 } |
144 | 154 |
145 scoped_refptr<RasterSource> DisplayListRecordingSource::CreateRasterSource() | 155 scoped_refptr<RasterSource> DisplayListRecordingSource::CreateRasterSource() |
146 const { | 156 const { |
(...skipping 19 matching lines...) Expand all Loading... |
166 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 176 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
167 } | 177 } |
168 | 178 |
169 void DisplayListRecordingSource::Clear() { | 179 void DisplayListRecordingSource::Clear() { |
170 recorded_viewport_ = gfx::Rect(); | 180 recorded_viewport_ = gfx::Rect(); |
171 display_list_ = NULL; | 181 display_list_ = NULL; |
172 is_solid_color_ = false; | 182 is_solid_color_ = false; |
173 } | 183 } |
174 | 184 |
175 } // namespace cc | 185 } // namespace cc |
OLD | NEW |