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