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/rasterize_and_record_benchmark.h" | 5 #include "cc/debug/rasterize_and_record_benchmark.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void RasterizeAndRecordBenchmark::RecordRasterResults( | 73 void RasterizeAndRecordBenchmark::RecordRasterResults( |
74 scoped_ptr<base::Value> results_value) { | 74 scoped_ptr<base::Value> results_value) { |
75 DCHECK(main_thread_benchmark_done_); | 75 DCHECK(main_thread_benchmark_done_); |
76 | 76 |
77 base::DictionaryValue* results = NULL; | 77 base::DictionaryValue* results = NULL; |
78 results_value->GetAsDictionary(&results); | 78 results_value->GetAsDictionary(&results); |
79 DCHECK(results); | 79 DCHECK(results); |
80 | 80 |
81 results_->MergeDictionary(results); | 81 results_->MergeDictionary(results); |
82 | 82 |
83 NotifyDone(results_.PassAs<base::Value>()); | 83 NotifyDone(results_.Pass()); |
84 } | 84 } |
85 | 85 |
86 scoped_ptr<MicroBenchmarkImpl> RasterizeAndRecordBenchmark::CreateBenchmarkImpl( | 86 scoped_ptr<MicroBenchmarkImpl> RasterizeAndRecordBenchmark::CreateBenchmarkImpl( |
87 scoped_refptr<base::MessageLoopProxy> origin_loop) { | 87 scoped_refptr<base::MessageLoopProxy> origin_loop) { |
88 return scoped_ptr<MicroBenchmarkImpl>(new RasterizeAndRecordBenchmarkImpl( | 88 return make_scoped_ptr(new RasterizeAndRecordBenchmarkImpl( |
89 origin_loop, | 89 origin_loop, |
90 settings_.get(), | 90 settings_.get(), |
91 base::Bind(&RasterizeAndRecordBenchmark::RecordRasterResults, | 91 base::Bind(&RasterizeAndRecordBenchmark::RecordRasterResults, |
92 weak_ptr_factory_.GetWeakPtr()))); | 92 weak_ptr_factory_.GetWeakPtr()))); |
93 } | 93 } |
94 | 94 |
95 void RasterizeAndRecordBenchmark::Run(Layer* layer) { | 95 void RasterizeAndRecordBenchmark::Run(Layer* layer) { |
96 layer->RunMicroBenchmark(this); | 96 layer->RunMicroBenchmark(this); |
97 } | 97 } |
98 | 98 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 record_results_.total_best_time[mode_index] += min_time; | 146 record_results_.total_best_time[mode_index] += min_time; |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
150 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 150 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
151 : pixels_recorded(0) {} | 151 : pixels_recorded(0) {} |
152 | 152 |
153 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 153 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
154 | 154 |
155 } // namespace cc | 155 } // namespace cc |
OLD | NEW |