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 <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 29 matching lines...) Expand all Loading... | |
40 // Run for a minimum amount of time to avoid problems with timer | 40 // Run for a minimum amount of time to avoid problems with timer |
41 // quantization when the layer is very small. | 41 // quantization when the layer is very small. |
42 LapTimer timer(kWarmupRuns, | 42 LapTimer timer(kWarmupRuns, |
43 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 43 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
44 kTimeCheckInterval); | 44 kTimeCheckInterval); |
45 do { | 45 do { |
46 SkBitmap bitmap; | 46 SkBitmap bitmap; |
47 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect.width(), | 47 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect.width(), |
48 content_rect.height())); | 48 content_rect.height())); |
49 SkCanvas canvas(bitmap); | 49 SkCanvas canvas(bitmap); |
50 DisplayListRasterSource::SolidColorAnalysis analysis; | 50 SkColor color = SK_ColorTRANSPARENT; |
51 | 51 |
52 raster_source->PerformSolidColorAnalysis(content_rect, contents_scale, | 52 *is_solid_color = raster_source->PerformSolidColorAnalysis( |
vmpstr
2015/12/29 21:24:23
I'm not sure what to do in this case. This is meas
sohanjg
2015/12/30 12:45:47
We are always issuing PlaybackToCanvas which would
| |
53 &analysis); | 53 content_rect, contents_scale, &color); |
54 raster_source->PlaybackToCanvas(&canvas, content_rect, content_rect, | 54 raster_source->PlaybackToCanvas(&canvas, content_rect, content_rect, |
55 contents_scale); | 55 contents_scale); |
56 | 56 |
57 *is_solid_color = analysis.is_solid_color; | |
58 | |
59 timer.NextLap(); | 57 timer.NextLap(); |
60 } while (!timer.HasTimeLimitExpired()); | 58 } while (!timer.HasTimeLimitExpired()); |
61 base::TimeDelta duration = | 59 base::TimeDelta duration = |
62 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); | 60 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); |
63 if (duration < *min_time) | 61 if (duration < *min_time) |
64 *min_time = duration; | 62 *min_time = duration; |
65 } | 63 } |
66 } | 64 } |
67 | 65 |
68 class FixedInvalidationPictureLayerTilingClient | 66 class FixedInvalidationPictureLayerTilingClient |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 total_memory_usage(0), | 213 total_memory_usage(0), |
216 total_layers(0), | 214 total_layers(0), |
217 total_picture_layers(0), | 215 total_picture_layers(0), |
218 total_picture_layers_with_no_content(0), | 216 total_picture_layers_with_no_content(0), |
219 total_picture_layers_off_screen(0) { | 217 total_picture_layers_off_screen(0) { |
220 } | 218 } |
221 | 219 |
222 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} | 220 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} |
223 | 221 |
224 } // namespace cc | 222 } // namespace cc |
OLD | NEW |