| 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_impl.h" | 5 #include "cc/debug/rasterize_and_record_benchmark_impl.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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 SkColor color = SK_ColorTRANSPARENT; | 47 SkColor color = SK_ColorTRANSPARENT; |
| 48 *is_solid_color = raster_source->PerformSolidColorAnalysis( | 48 *is_solid_color = raster_source->PerformSolidColorAnalysis( |
| 49 content_rect, raster_scale, &color); | 49 content_rect, raster_scale, &color); |
| 50 | 50 |
| 51 do { | 51 do { |
| 52 SkBitmap bitmap; | 52 SkBitmap bitmap; |
| 53 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect.width(), | 53 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect.width(), |
| 54 content_rect.height())); | 54 content_rect.height())); |
| 55 SkCanvas canvas(bitmap); | 55 SkCanvas canvas(bitmap); |
| 56 | 56 |
| 57 raster_source->PlaybackToCanvas(&canvas, content_rect, content_rect, | 57 raster_source->PlaybackToCanvas( |
| 58 ScaleTranslate2d(raster_scale, gfx::Vector
2dF()), | 58 &canvas, content_rect, content_rect, |
| 59 RasterSource::PlaybackSettings()); | 59 ScaleTranslate2d(raster_scale, gfx::Vector2dF()), |
| 60 RasterSource::PlaybackSettings()); |
| 60 | 61 |
| 61 timer.NextLap(); | 62 timer.NextLap(); |
| 62 } while (!timer.HasTimeLimitExpired()); | 63 } while (!timer.HasTimeLimitExpired()); |
| 63 base::TimeDelta duration = | 64 base::TimeDelta duration = |
| 64 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); | 65 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); |
| 65 if (duration < *min_time) | 66 if (duration < *min_time) |
| 66 *min_time = duration; | 67 *min_time = duration; |
| 67 } | 68 } |
| 68 } | 69 } |
| 69 | 70 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 total_memory_usage(0), | 221 total_memory_usage(0), |
| 221 total_layers(0), | 222 total_layers(0), |
| 222 total_picture_layers(0), | 223 total_picture_layers(0), |
| 223 total_picture_layers_with_no_content(0), | 224 total_picture_layers_with_no_content(0), |
| 224 total_picture_layers_off_screen(0) { | 225 total_picture_layers_off_screen(0) { |
| 225 } | 226 } |
| 226 | 227 |
| 227 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} | 228 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} |
| 228 | 229 |
| 229 } // namespace cc | 230 } // namespace cc |
| OLD | NEW |