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

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

Issue 1226503006: cc: More consistent reasoning about display list memory usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: capacity unit test Created 5 years, 5 months 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 PlaybackToCanvas(canvas, display_list_rect, display_list_rect, 1.0); 131 PlaybackToCanvas(canvas, display_list_rect, display_list_rect, 1.0);
132 skia::RefPtr<SkPicture> picture = 132 skia::RefPtr<SkPicture> picture =
133 skia::AdoptRef(recorder.endRecordingAsPicture()); 133 skia::AdoptRef(recorder.endRecordingAsPicture());
134 134
135 return picture; 135 return picture;
136 } 136 }
137 137
138 size_t DisplayListRasterSource::GetPictureMemoryUsage() const { 138 size_t DisplayListRasterSource::GetPictureMemoryUsage() const {
139 if (!display_list_) 139 if (!display_list_)
140 return 0; 140 return 0;
141 return display_list_->PictureMemoryUsage(); 141 return display_list_->ApproximateMemoryUsage();
142 } 142 }
143 143
144 void DisplayListRasterSource::PerformSolidColorAnalysis( 144 void DisplayListRasterSource::PerformSolidColorAnalysis(
145 const gfx::Rect& content_rect, 145 const gfx::Rect& content_rect,
146 float contents_scale, 146 float contents_scale,
147 RasterSource::SolidColorAnalysis* analysis) const { 147 RasterSource::SolidColorAnalysis* analysis) const {
148 DCHECK(analysis); 148 DCHECK(analysis);
149 TRACE_EVENT0("cc", "DisplayListRasterSource::PerformSolidColorAnalysis"); 149 TRACE_EVENT0("cc", "DisplayListRasterSource::PerformSolidColorAnalysis");
150 150
151 gfx::Rect layer_rect = 151 gfx::Rect layer_rect =
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 226
227 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText() 227 scoped_refptr<RasterSource> DisplayListRasterSource::CreateCloneWithoutLCDText()
228 const { 228 const {
229 bool can_use_lcd_text = false; 229 bool can_use_lcd_text = false;
230 return scoped_refptr<RasterSource>( 230 return scoped_refptr<RasterSource>(
231 new DisplayListRasterSource(this, can_use_lcd_text)); 231 new DisplayListRasterSource(this, can_use_lcd_text));
232 } 232 }
233 233
234 } // namespace cc 234 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698