| 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/micro_benchmark_controller.h" | 5 #include "cc/debug/micro_benchmark_controller.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 if (benchmark_impl.get()) | 98 if (benchmark_impl.get()) |
| 99 host_impl->ScheduleMicroBenchmark(std::move(benchmark_impl)); | 99 host_impl->ScheduleMicroBenchmark(std::move(benchmark_impl)); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 void MicroBenchmarkController::DidUpdateLayers() { | 103 void MicroBenchmarkController::DidUpdateLayers() { |
| 104 for (const auto& benchmark : benchmarks_) { | 104 for (const auto& benchmark : benchmarks_) { |
| 105 if (!benchmark->IsDone()) | 105 if (!benchmark->IsDone()) |
| 106 benchmark->DidUpdateLayers(host_->GetLayerTree()); | 106 benchmark->DidUpdateLayers(host_); |
| 107 } | 107 } |
| 108 | 108 |
| 109 CleanUpFinishedBenchmarks(); | 109 CleanUpFinishedBenchmarks(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void MicroBenchmarkController::CleanUpFinishedBenchmarks() { | 112 void MicroBenchmarkController::CleanUpFinishedBenchmarks() { |
| 113 benchmarks_.erase( | 113 benchmarks_.erase( |
| 114 std::remove_if(benchmarks_.begin(), benchmarks_.end(), | 114 std::remove_if(benchmarks_.begin(), benchmarks_.end(), |
| 115 [](const std::unique_ptr<MicroBenchmark>& benchmark) { | 115 [](const std::unique_ptr<MicroBenchmark>& benchmark) { |
| 116 return benchmark->IsDone(); | 116 return benchmark->IsDone(); |
| 117 }), | 117 }), |
| 118 benchmarks_.end()); | 118 benchmarks_.end()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace cc | 121 } // namespace cc |
| OLD | NEW |