| OLD | NEW |
| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // quantization when the layer is very small. | 159 // quantization when the layer is very small. |
| 160 LapTimer timer(kWarmupRuns, | 160 LapTimer timer(kWarmupRuns, |
| 161 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 161 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
| 162 kTimeCheckInterval); | 162 kTimeCheckInterval); |
| 163 | 163 |
| 164 do { | 164 do { |
| 165 display_list = painter->PaintContentsToDisplayList(painting_control); | 165 display_list = painter->PaintContentsToDisplayList(painting_control); |
| 166 if (display_list->ShouldBeAnalyzedForSolidColor()) { | 166 if (display_list->ShouldBeAnalyzedForSolidColor()) { |
| 167 gfx::Size layer_size = layer->paint_properties().bounds; | 167 gfx::Size layer_size = layer->paint_properties().bounds; |
| 168 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); | 168 skia::AnalysisCanvas canvas(layer_size.width(), layer_size.height()); |
| 169 display_list->Raster(&canvas, nullptr, gfx::Rect(), 1.f); | 169 display_list->Raster(&canvas, nullptr, visible_layer_rect, 1.f); |
| 170 } | 170 } |
| 171 | 171 |
| 172 if (memory_used) { | 172 if (memory_used) { |
| 173 // Verify we are recording the same thing each time. | 173 // Verify we are recording the same thing each time. |
| 174 DCHECK_EQ(memory_used, display_list->ApproximateMemoryUsage()); | 174 DCHECK_EQ(memory_used, display_list->ApproximateMemoryUsage()); |
| 175 } else { | 175 } else { |
| 176 memory_used = display_list->ApproximateMemoryUsage(); | 176 memory_used = display_list->ApproximateMemoryUsage(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 timer.NextLap(); | 179 timer.NextLap(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 | 196 |
| 197 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 197 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
| 198 : pixels_recorded(0), bytes_used(0) { | 198 : pixels_recorded(0), bytes_used(0) { |
| 199 } | 199 } |
| 200 | 200 |
| 201 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 201 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
| 202 | 202 |
| 203 } // namespace cc | 203 } // namespace cc |
| OLD | NEW |