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

Side by Side Diff: cc/debug/rasterize_and_record_benchmark.cc

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 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
« no previous file with comments | « cc/blink/web_display_item_list_impl.cc ('k') | cc/debug/rasterize_and_record_benchmark_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/debug/rasterize_and_record_benchmark.h" 5 #include "cc/debug/rasterize_and_record_benchmark.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // quantization when the layer is very small. 153 // quantization when the layer is very small.
154 LapTimer timer(kWarmupRuns, 154 LapTimer timer(kWarmupRuns,
155 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), 155 base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
156 kTimeCheckInterval); 156 kTimeCheckInterval);
157 157
158 do { 158 do {
159 display_list = painter->PaintContentsToDisplayList(painting_control); 159 display_list = painter->PaintContentsToDisplayList(painting_control);
160 if (display_list->ShouldBeAnalyzedForSolidColor()) { 160 if (display_list->ShouldBeAnalyzedForSolidColor()) {
161 gfx::Size layer_size = layer->paint_properties().bounds; 161 gfx::Size layer_size = layer->paint_properties().bounds;
162 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); 162 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height());
163 display_list->Raster(&canvas, nullptr, gfx::Rect(layer_size), 1.f); 163 CdlPassThroughCanvas cdl_canvas(&canvas);
164 display_list->Raster(&cdl_canvas, nullptr, gfx::Rect(layer_size),
165 1.f);
164 } 166 }
165 167
166 if (memory_used) { 168 if (memory_used) {
167 // Verify we are recording the same thing each time. 169 // Verify we are recording the same thing each time.
168 DCHECK_EQ(memory_used, display_list->ApproximateMemoryUsage()); 170 DCHECK_EQ(memory_used, display_list->ApproximateMemoryUsage());
169 } else { 171 } else {
170 memory_used = display_list->ApproximateMemoryUsage(); 172 memory_used = display_list->ApproximateMemoryUsage();
171 } 173 }
172 174
173 timer.NextLap(); 175 timer.NextLap();
(...skipping 14 matching lines...) Expand all
188 } 190 }
189 } 191 }
190 192
191 RasterizeAndRecordBenchmark::RecordResults::RecordResults() 193 RasterizeAndRecordBenchmark::RecordResults::RecordResults()
192 : pixels_recorded(0), bytes_used(0) { 194 : pixels_recorded(0), bytes_used(0) {
193 } 195 }
194 196
195 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} 197 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {}
196 198
197 } // namespace cc 199 } // namespace cc
OLDNEW
« no previous file with comments | « cc/blink/web_display_item_list_impl.cc ('k') | cc/debug/rasterize_and_record_benchmark_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698