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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 base::TimeDelta::FromInternalValue(std::numeric_limits<int64>::max()); | 87 base::TimeDelta::FromInternalValue(std::numeric_limits<int64>::max()); |
88 for (int i = 0; i < rasterize_repeat_count_; ++i) { | 88 for (int i = 0; i < rasterize_repeat_count_; ++i) { |
89 SkBitmap bitmap; | 89 SkBitmap bitmap; |
90 bitmap.setConfig(SkBitmap::kARGB_8888_Config, | 90 bitmap.setConfig(SkBitmap::kARGB_8888_Config, |
91 content_rect.width(), | 91 content_rect.width(), |
92 content_rect.height()); | 92 content_rect.height()); |
93 bitmap.allocPixels(); | 93 bitmap.allocPixels(); |
94 | 94 |
95 SkBitmapDevice device(bitmap); | 95 SkBitmapDevice device(bitmap); |
96 SkCanvas canvas(&device); | 96 SkCanvas canvas(&device); |
| 97 PicturePileImpl::Analysis analysis; |
97 | 98 |
98 base::TimeTicks start = Now(); | 99 base::TimeTicks start = Now(); |
| 100 picture_pile->AnalyzeInRect( |
| 101 content_rect, contents_scale, &analysis, NULL); |
99 picture_pile->RasterToBitmap(&canvas, content_rect, contents_scale, NULL); | 102 picture_pile->RasterToBitmap(&canvas, content_rect, contents_scale, NULL); |
100 base::TimeTicks end = Now(); | 103 base::TimeTicks end = Now(); |
101 base::TimeDelta duration = end - start; | 104 base::TimeDelta duration = end - start; |
102 if (duration < min_time) | 105 if (duration < min_time) |
103 min_time = duration; | 106 min_time = duration; |
104 } | 107 } |
105 | 108 |
106 rasterize_results_.pixels_rasterized += | 109 rasterize_results_.pixels_rasterized += |
107 content_rect.width() * content_rect.height(); | 110 content_rect.width() * content_rect.height(); |
108 rasterize_results_.total_best_time += min_time; | 111 rasterize_results_.total_best_time += min_time; |
109 } | 112 } |
110 } | 113 } |
111 | 114 |
112 RasterizeAndRecordBenchmarkImpl::RasterizeResults::RasterizeResults() | 115 RasterizeAndRecordBenchmarkImpl::RasterizeResults::RasterizeResults() |
113 : pixels_rasterized(0) {} | 116 : pixels_rasterized(0) {} |
114 | 117 |
115 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} | 118 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} |
116 | 119 |
117 } // namespace cc | 120 } // namespace cc |
OLD | NEW |