| 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/playback/recording_source.h" | 5 #include "cc/layers/recording_source.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "base/numerics/safe_math.h" | 11 #include "base/numerics/safe_math.h" |
| 12 #include "cc/base/region.h" | 12 #include "cc/base/region.h" |
| 13 #include "cc/layers/content_layer_client.h" | 13 #include "cc/layers/content_layer_client.h" |
| 14 #include "cc/playback/display_item_list.h" | 14 #include "cc/paint/display_item_list.h" |
| 15 #include "cc/playback/raster_source.h" | 15 #include "cc/raster/raster_source.h" |
| 16 #include "skia/ext/analysis_canvas.h" | 16 #include "skia/ext/analysis_canvas.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 #ifdef NDEBUG | 20 #ifdef NDEBUG |
| 21 const bool kDefaultClearCanvasSetting = false; | 21 const bool kDefaultClearCanvasSetting = false; |
| 22 #else | 22 #else |
| 23 const bool kDefaultClearCanvasSetting = true; | 23 const bool kDefaultClearCanvasSetting = true; |
| 24 #endif | 24 #endif |
| 25 | 25 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 TRACE_EVENT1("cc", "RecordingSource::DetermineIfSolidColor", "opcount", | 155 TRACE_EVENT1("cc", "RecordingSource::DetermineIfSolidColor", "opcount", |
| 156 display_list_->ApproximateOpCount()); | 156 display_list_->ApproximateOpCount()); |
| 157 gfx::Size layer_size = GetSize(); | 157 gfx::Size layer_size = GetSize(); |
| 158 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); | 158 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); |
| 159 display_list_->Raster(&canvas, nullptr, gfx::Rect(layer_size), 1.f); | 159 display_list_->Raster(&canvas, nullptr, gfx::Rect(layer_size), 1.f); |
| 160 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 160 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace cc | 163 } // namespace cc |
| OLD | NEW |