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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 std::pair<int, int> dimensions = dimensions_[i]; | 103 std::pair<int, int> dimensions = dimensions_[i]; |
104 int width = dimensions.first; | 104 int width = dimensions.first; |
105 int height = dimensions.second; | 105 int height = dimensions.second; |
106 | 106 |
107 int y_limit = std::max(1, content_bounds.height() - height); | 107 int y_limit = std::max(1, content_bounds.height() - height); |
108 int x_limit = std::max(1, content_bounds.width() - width); | 108 int x_limit = std::max(1, content_bounds.width() - width); |
109 for (int y = 0; y < y_limit; y += kPositionIncrement) { | 109 for (int y = 0; y < y_limit; y += kPositionIncrement) { |
110 for (int x = 0; x < x_limit; x += kPositionIncrement) { | 110 for (int x = 0; x < x_limit; x += kPositionIncrement) { |
111 gfx::Rect rect = gfx::Rect(x, y, width, height); | 111 gfx::Rect rect = gfx::Rect(x, y, width, height); |
112 | 112 |
113 base::TimeTicks start = base::TimeTicks::HighResNow(); | 113 base::TimeTicks start = base::TimeTicks::Now(); |
114 | 114 |
115 scoped_refptr<Picture> picture = Picture::Create( | 115 scoped_refptr<Picture> picture = Picture::Create( |
116 rect, painter, tile_grid_info, false, Picture::RECORD_NORMALLY); | 116 rect, painter, tile_grid_info, false, Picture::RECORD_NORMALLY); |
117 | 117 |
118 base::TimeTicks end = base::TimeTicks::HighResNow(); | 118 base::TimeTicks end = base::TimeTicks::Now(); |
119 base::TimeDelta duration = end - start; | 119 base::TimeDelta duration = end - start; |
120 TotalTime& total_time = times_[dimensions]; | 120 TotalTime& total_time = times_[dimensions]; |
121 total_time.first += duration; | 121 total_time.first += duration; |
122 total_time.second++; | 122 total_time.second++; |
123 } | 123 } |
124 } | 124 } |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 } // namespace cc | 128 } // namespace cc |
OLD | NEW |