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/picture_record_benchmark.h" | 5 #include "cc/debug/picture_record_benchmark.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 86 matching lines...) Loading... |
97 std::pair<int, int> dimensions = dimensions_[i]; | 97 std::pair<int, int> dimensions = dimensions_[i]; |
98 int width = dimensions.first; | 98 int width = dimensions.first; |
99 int height = dimensions.second; | 99 int height = dimensions.second; |
100 | 100 |
101 int y_limit = std::max(1, content_bounds.height() - height); | 101 int y_limit = std::max(1, content_bounds.height() - height); |
102 int x_limit = std::max(1, content_bounds.width() - width); | 102 int x_limit = std::max(1, content_bounds.width() - width); |
103 for (int y = 0; y < y_limit; y += kPositionIncrement) { | 103 for (int y = 0; y < y_limit; y += kPositionIncrement) { |
104 for (int x = 0; x < x_limit; x += kPositionIncrement) { | 104 for (int x = 0; x < x_limit; x += kPositionIncrement) { |
105 gfx::Rect rect = gfx::Rect(x, y, width, height); | 105 gfx::Rect rect = gfx::Rect(x, y, width, height); |
106 | 106 |
107 base::TimeTicks start = base::TimeTicks::HighResNow(); | 107 base::TimeTicks start = base::TimeTicks::Now(); |
108 | 108 |
109 scoped_refptr<Picture> picture = Picture::Create( | 109 scoped_refptr<Picture> picture = Picture::Create( |
110 rect, painter, tile_grid_size, false, Picture::RECORD_NORMALLY); | 110 rect, painter, tile_grid_size, false, Picture::RECORD_NORMALLY); |
111 | 111 |
112 base::TimeTicks end = base::TimeTicks::HighResNow(); | 112 base::TimeTicks end = base::TimeTicks::Now(); |
113 base::TimeDelta duration = end - start; | 113 base::TimeDelta duration = end - start; |
114 TotalTime& total_time = times_[dimensions]; | 114 TotalTime& total_time = times_[dimensions]; |
115 total_time.first += duration; | 115 total_time.first += duration; |
116 total_time.second++; | 116 total_time.second++; |
117 } | 117 } |
118 } | 118 } |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 } // namespace cc | 122 } // namespace cc |
OLD | NEW |