| 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/playback/recording_source.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 is_solid_color_ = false; | 225 is_solid_color_ = false; |
| 226 solid_color_ = SK_ColorTRANSPARENT; | 226 solid_color_ = SK_ColorTRANSPARENT; |
| 227 | 227 |
| 228 if (!display_list_->ShouldBeAnalyzedForSolidColor()) | 228 if (!display_list_->ShouldBeAnalyzedForSolidColor()) |
| 229 return; | 229 return; |
| 230 | 230 |
| 231 TRACE_EVENT1("cc", "RecordingSource::DetermineIfSolidColor", "opcount", | 231 TRACE_EVENT1("cc", "RecordingSource::DetermineIfSolidColor", "opcount", |
| 232 display_list_->ApproximateOpCount()); | 232 display_list_->ApproximateOpCount()); |
| 233 gfx::Size layer_size = GetSize(); | 233 gfx::Size layer_size = GetSize(); |
| 234 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); | 234 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); |
| 235 display_list_->Raster(&canvas, nullptr, gfx::Rect(), 1.f); | 235 display_list_->Raster(&canvas, nullptr, gfx::Rect(layer_size), 1.f); |
| 236 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); | 236 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void RecordingSource::Clear() { | 239 void RecordingSource::Clear() { |
| 240 recorded_viewport_ = gfx::Rect(); | 240 recorded_viewport_ = gfx::Rect(); |
| 241 display_list_ = nullptr; | 241 display_list_ = nullptr; |
| 242 painter_reported_memory_usage_ = 0; | 242 painter_reported_memory_usage_ = 0; |
| 243 is_solid_color_ = false; | 243 is_solid_color_ = false; |
| 244 } | 244 } |
| 245 | 245 |
| 246 } // namespace cc | 246 } // namespace cc |
| OLD | NEW |