| 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 10 matching lines...) Expand all Loading... |
| 21 // We don't perform solid color analysis on images that have more than 10 skia | 21 // We don't perform solid color analysis on images that have more than 10 skia |
| 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 gather_pixel_refs_(false), |
| 31 requires_clear_(false), | 32 requires_clear_(false), |
| 32 is_solid_color_(false), | 33 is_solid_color_(false), |
| 33 solid_color_(SK_ColorTRANSPARENT), | 34 solid_color_(SK_ColorTRANSPARENT), |
| 34 background_color_(SK_ColorTRANSPARENT), | 35 background_color_(SK_ColorTRANSPARENT), |
| 35 pixel_record_distance_(kPixelDistanceToRecord), | 36 pixel_record_distance_(kPixelDistanceToRecord), |
| 36 is_suitable_for_gpu_rasterization_(true) { | 37 is_suitable_for_gpu_rasterization_(true) { |
| 37 } | 38 } |
| 38 | 39 |
| 39 DisplayListRecordingSource::~DisplayListRecordingSource() { | 40 DisplayListRecordingSource::~DisplayListRecordingSource() { |
| 40 } | 41 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 129 |
| 129 void DisplayListRecordingSource::SetEmptyBounds() { | 130 void DisplayListRecordingSource::SetEmptyBounds() { |
| 130 size_ = gfx::Size(); | 131 size_ = gfx::Size(); |
| 131 Clear(); | 132 Clear(); |
| 132 } | 133 } |
| 133 | 134 |
| 134 void DisplayListRecordingSource::SetSlowdownRasterScaleFactor(int factor) { | 135 void DisplayListRecordingSource::SetSlowdownRasterScaleFactor(int factor) { |
| 135 slow_down_raster_scale_factor_for_debug_ = factor; | 136 slow_down_raster_scale_factor_for_debug_ = factor; |
| 136 } | 137 } |
| 137 | 138 |
| 139 void DisplayListRecordingSource::SetGatherPixelRefs(bool gather_pixel_refs) { |
| 140 gather_pixel_refs_ = gather_pixel_refs; |
| 141 } |
| 142 |
| 138 void DisplayListRecordingSource::SetBackgroundColor(SkColor background_color) { | 143 void DisplayListRecordingSource::SetBackgroundColor(SkColor background_color) { |
| 139 background_color_ = background_color; | 144 background_color_ = background_color; |
| 140 } | 145 } |
| 141 | 146 |
| 142 void DisplayListRecordingSource::SetRequiresClear(bool requires_clear) { | 147 void DisplayListRecordingSource::SetRequiresClear(bool requires_clear) { |
| 143 requires_clear_ = requires_clear; | 148 requires_clear_ = requires_clear; |
| 144 } | 149 } |
| 145 | 150 |
| 146 void DisplayListRecordingSource::SetUnsuitableForGpuRasterizationForTesting() { | 151 void DisplayListRecordingSource::SetUnsuitableForGpuRasterizationForTesting() { |
| 147 is_suitable_for_gpu_rasterization_ = false; | 152 is_suitable_for_gpu_rasterization_ = false; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 176 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 181 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
| 177 } | 182 } |
| 178 | 183 |
| 179 void DisplayListRecordingSource::Clear() { | 184 void DisplayListRecordingSource::Clear() { |
| 180 recorded_viewport_ = gfx::Rect(); | 185 recorded_viewport_ = gfx::Rect(); |
| 181 display_list_ = NULL; | 186 display_list_ = NULL; |
| 182 is_solid_color_ = false; | 187 is_solid_color_ = false; |
| 183 } | 188 } |
| 184 | 189 |
| 185 } // namespace cc | 190 } // namespace cc |
| OLD | NEW |