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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); | 74 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); |
75 result->SetInteger("width", dimensions.first); | 75 result->SetInteger("width", dimensions.first); |
76 result->SetInteger("height", dimensions.second); | 76 result->SetInteger("height", dimensions.second); |
77 result->SetInteger("samples_count", total_count); | 77 result->SetInteger("samples_count", total_count); |
78 result->SetDouble("time_ms", average_time); | 78 result->SetDouble("time_ms", average_time); |
79 | 79 |
80 results->Append(result.release()); | 80 results->Append(result.release()); |
81 } | 81 } |
82 | 82 |
83 NotifyDone(results.PassAs<base::Value>()); | 83 NotifyDone(results.Pass()); |
84 } | 84 } |
85 | 85 |
86 void PictureRecordBenchmark::Run(Layer* layer) { | 86 void PictureRecordBenchmark::Run(Layer* layer) { |
87 layer->RunMicroBenchmark(this); | 87 layer->RunMicroBenchmark(this); |
88 } | 88 } |
89 | 89 |
90 void PictureRecordBenchmark::RunOnLayer(PictureLayer* layer) { | 90 void PictureRecordBenchmark::RunOnLayer(PictureLayer* layer) { |
91 ContentLayerClient* painter = layer->client(); | 91 ContentLayerClient* painter = layer->client(); |
92 gfx::Size content_bounds = layer->content_bounds(); | 92 gfx::Size content_bounds = layer->content_bounds(); |
93 | 93 |
(...skipping 23 matching lines...) Expand all Loading... |
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 |