| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if (settings->HasKey("record_repeat_count")) | 63 if (settings->HasKey("record_repeat_count")) |
| 64 settings->GetInteger("record_repeat_count", &record_repeat_count_); | 64 settings->GetInteger("record_repeat_count", &record_repeat_count_); |
| 65 } | 65 } |
| 66 | 66 |
| 67 RasterizeAndRecordBenchmark::~RasterizeAndRecordBenchmark() { | 67 RasterizeAndRecordBenchmark::~RasterizeAndRecordBenchmark() { |
| 68 weak_ptr_factory_.InvalidateWeakPtrs(); | 68 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void RasterizeAndRecordBenchmark::DidUpdateLayers(LayerTreeHost* host) { | 71 void RasterizeAndRecordBenchmark::DidUpdateLayers(LayerTreeHost* host) { |
| 72 host_ = host; | 72 host_ = host; |
| 73 LayerTreeHostCommon::CallFunctionForSubtree( | 73 LayerTreeHostCommon::CallFunctionForEveryLayer( |
| 74 host->root_layer(), | 74 host->root_layer(), |
| 75 [this](Layer* layer) { layer->RunMicroBenchmark(this); }); | 75 [this](Layer* layer) { layer->RunMicroBenchmark(this); }); |
| 76 | 76 |
| 77 DCHECK(!results_.get()); | 77 DCHECK(!results_.get()); |
| 78 results_ = make_scoped_ptr(new base::DictionaryValue); | 78 results_ = make_scoped_ptr(new base::DictionaryValue); |
| 79 results_->SetInteger("pixels_recorded", record_results_.pixels_recorded); | 79 results_->SetInteger("pixels_recorded", record_results_.pixels_recorded); |
| 80 results_->SetInteger("picture_memory_usage", | 80 results_->SetInteger("picture_memory_usage", |
| 81 static_cast<int>(record_results_.bytes_used)); | 81 static_cast<int>(record_results_.bytes_used)); |
| 82 | 82 |
| 83 for (int i = 0; i < DisplayListRecordingSource::RECORDING_MODE_COUNT; i++) { | 83 for (int i = 0; i < DisplayListRecordingSource::RECORDING_MODE_COUNT; i++) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 | 196 |
| 197 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 197 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
| 198 : pixels_recorded(0), bytes_used(0) { | 198 : pixels_recorded(0), bytes_used(0) { |
| 199 } | 199 } |
| 200 | 200 |
| 201 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 201 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
| 202 | 202 |
| 203 } // namespace cc | 203 } // namespace cc |
| OLD | NEW |