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

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

Issue 1531013004: cc: Do solid color analysis before scheduling tiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_raster_source.h" 5 #include "cc/playback/display_list_raster_source.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "cc/base/region.h" 8 #include "cc/base/region.h"
9 #include "cc/debug/debug_colors.h" 9 #include "cc/debug/debug_colors.h"
10 #include "cc/playback/display_item_list.h" 10 #include "cc/playback/display_item_list.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 return picture; 210 return picture;
211 } 211 }
212 212
213 size_t DisplayListRasterSource::GetPictureMemoryUsage() const { 213 size_t DisplayListRasterSource::GetPictureMemoryUsage() const {
214 if (!display_list_) 214 if (!display_list_)
215 return 0; 215 return 0;
216 return display_list_->ApproximateMemoryUsage() + 216 return display_list_->ApproximateMemoryUsage() +
217 painter_reported_memory_usage_; 217 painter_reported_memory_usage_;
218 } 218 }
219 219
220 bool DisplayListRasterSource::IsSolidColorTile(gfx::Rect content_rect,
vmpstr 2015/12/17 18:55:47 Can you use PerformSolidColorAnalysis instead? Tha
sohanjg 2015/12/18 12:50:00 Yes, i thought we would remove PerformSolidColorAn
vmpstr 2015/12/18 19:03:06 I don't a rename, it's just this is the patch that
sohanjg 2015/12/29 14:29:47 Acknowledged.
221 float scale,
222 SkColor* color) {
223 DCHECK(display_list_);
224
225 if (!display_list_->ShouldBeAnalyzedForSolidColor()) {
226 return false;
227 }
228
229 skia::AnalysisCanvas canvas(content_rect.width(), content_rect.height());
230 RasterForAnalysis(&canvas, content_rect, scale);
231 return canvas.GetColorIfSolid(color);
232 }
233
220 void DisplayListRasterSource::PerformSolidColorAnalysis( 234 void DisplayListRasterSource::PerformSolidColorAnalysis(
221 const gfx::Rect& content_rect, 235 const gfx::Rect& content_rect,
222 float contents_scale, 236 float contents_scale,
223 DisplayListRasterSource::SolidColorAnalysis* analysis) const { 237 DisplayListRasterSource::SolidColorAnalysis* analysis) const {
224 DCHECK(analysis); 238 DCHECK(analysis);
225 TRACE_EVENT0("cc", "DisplayListRasterSource::PerformSolidColorAnalysis"); 239 TRACE_EVENT0("cc", "DisplayListRasterSource::PerformSolidColorAnalysis");
226 240
227 gfx::Rect layer_rect = 241 gfx::Rect layer_rect =
228 gfx::ScaleToEnclosingRect(content_rect, 1.0f / contents_scale); 242 gfx::ScaleToEnclosingRect(content_rect, 1.0f / contents_scale);
229 243
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 308 }
295 309
296 scoped_refptr<DisplayListRasterSource> 310 scoped_refptr<DisplayListRasterSource>
297 DisplayListRasterSource::CreateCloneWithoutLCDText() const { 311 DisplayListRasterSource::CreateCloneWithoutLCDText() const {
298 bool can_use_lcd_text = false; 312 bool can_use_lcd_text = false;
299 return scoped_refptr<DisplayListRasterSource>( 313 return scoped_refptr<DisplayListRasterSource>(
300 new DisplayListRasterSource(this, can_use_lcd_text)); 314 new DisplayListRasterSource(this, can_use_lcd_text));
301 } 315 }
302 316
303 } // namespace cc 317 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698