Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: cc/playback/display_list_recording_source.cc

Issue 1484163002: Raster display item lists via a visual rect RTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/display_list_recording_source.h" 5 #include "cc/playback/display_list_recording_source.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/numerics/safe_math.h" 9 #include "base/numerics/safe_math.h"
10 #include "cc/base/histograms.h" 10 #include "cc/base/histograms.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 void DisplayListRecordingSource::DetermineIfSolidColor() { 169 void DisplayListRecordingSource::DetermineIfSolidColor() {
170 DCHECK(display_list_); 170 DCHECK(display_list_);
171 is_solid_color_ = false; 171 is_solid_color_ = false;
172 solid_color_ = SK_ColorTRANSPARENT; 172 solid_color_ = SK_ColorTRANSPARENT;
173 173
174 if (!display_list_->ShouldBeAnalyzedForSolidColor()) 174 if (!display_list_->ShouldBeAnalyzedForSolidColor())
175 return; 175 return;
176 176
177 gfx::Size layer_size = GetSize(); 177 gfx::Size layer_size = GetSize();
178 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); 178 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height());
179 display_list_->Raster(&canvas, nullptr, gfx::Rect(), 1.f); 179 display_list_->Raster(&canvas, nullptr, gfx::Rect(layer_size), 1.f);
180 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_); 180 is_solid_color_ = canvas.GetColorIfSolid(&solid_color_);
181 } 181 }
182 182
183 void DisplayListRecordingSource::Clear() { 183 void DisplayListRecordingSource::Clear() {
184 recorded_viewport_ = gfx::Rect(); 184 recorded_viewport_ = gfx::Rect();
185 display_list_ = nullptr; 185 display_list_ = nullptr;
186 painter_reported_memory_usage_ = 0; 186 painter_reported_memory_usage_ = 0;
187 is_solid_color_ = false; 187 is_solid_color_ = false;
188 } 188 }
189 189
190 } // namespace cc 190 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698