| 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" |
| 11 #include "cc/layers/layer.h" | 11 #include "cc/layers/layer.h" |
| 12 #include "cc/layers/picture_layer.h" | 12 #include "cc/layers/picture_layer.h" |
| 13 #include "cc/trees/layer_tree_host.h" | 13 #include "cc/trees/layer_tree_host.h" |
| 14 #include "cc/trees/layer_tree_host_common.h" | 14 #include "cc/trees/layer_tree_host_common.h" |
| 15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 const int kPositionIncrement = 100; | 21 const int kPositionIncrement = 100; |
| 22 const int kTileGridSize = 512; | 22 const int kTileGridSize = 512; |
| 23 const int kTileGridBorder = 1; | 23 const int kTileGridBorder = 1; |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 PictureRecordBenchmark::PictureRecordBenchmark( | 27 PictureRecordBenchmark::PictureRecordBenchmark( |
| 28 scoped_ptr<base::Value> value, | 28 scoped_ptr<base::Value> value, |
| 29 const MicroBenchmark::DoneCallback& callback) | 29 const MicroBenchmark::DoneCallback& callback, |
| 30 : MicroBenchmark(callback) { | 30 int id) |
| 31 : MicroBenchmark(callback, id) { |
| 31 if (!value) | 32 if (!value) |
| 32 return; | 33 return; |
| 33 | 34 |
| 34 base::ListValue* list = NULL; | 35 base::ListValue* list = NULL; |
| 35 value->GetAsList(&list); | 36 value->GetAsList(&list); |
| 36 if (!list) | 37 if (!list) |
| 37 return; | 38 return; |
| 38 | 39 |
| 39 for (base::ListValue::iterator it = list->begin(); it != list->end(); ++it) { | 40 for (base::ListValue::iterator it = list->begin(); it != list->end(); ++it) { |
| 40 base::DictionaryValue* dictionary = NULL; | 41 base::DictionaryValue* dictionary = NULL; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 base::TimeDelta duration = end - start; | 118 base::TimeDelta duration = end - start; |
| 118 TotalTime& total_time = times_[dimensions]; | 119 TotalTime& total_time = times_[dimensions]; |
| 119 total_time.first += duration; | 120 total_time.first += duration; |
| 120 total_time.second++; | 121 total_time.second++; |
| 121 } | 122 } |
| 122 } | 123 } |
| 123 } | 124 } |
| 124 } | 125 } |
| 125 | 126 |
| 126 } // namespace cc | 127 } // namespace cc |
| OLD | NEW |