| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 98 } |
| 99 | 99 |
| 100 if (benchmark_impl.get()) | 100 if (benchmark_impl.get()) |
| 101 host_impl->ScheduleMicroBenchmark(std::move(benchmark_impl)); | 101 host_impl->ScheduleMicroBenchmark(std::move(benchmark_impl)); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 void MicroBenchmarkController::DidUpdateLayers() { | 105 void MicroBenchmarkController::DidUpdateLayers() { |
| 106 for (const auto& benchmark : benchmarks_) { | 106 for (const auto& benchmark : benchmarks_) { |
| 107 if (!benchmark->IsDone()) | 107 if (!benchmark->IsDone()) |
| 108 benchmark->DidUpdateLayers(host_); | 108 benchmark->DidUpdateLayers(host_->GetLayerTree()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 CleanUpFinishedBenchmarks(); | 111 CleanUpFinishedBenchmarks(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void MicroBenchmarkController::CleanUpFinishedBenchmarks() { | 114 void MicroBenchmarkController::CleanUpFinishedBenchmarks() { |
| 115 benchmarks_.erase( | 115 benchmarks_.erase( |
| 116 std::remove_if(benchmarks_.begin(), benchmarks_.end(), | 116 std::remove_if(benchmarks_.begin(), benchmarks_.end(), |
| 117 [](const std::unique_ptr<MicroBenchmark>& benchmark) { | 117 [](const std::unique_ptr<MicroBenchmark>& benchmark) { |
| 118 return benchmark->IsDone(); | 118 return benchmark->IsDone(); |
| 119 }), | 119 }), |
| 120 benchmarks_.end()); | 120 benchmarks_.end()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace cc | 123 } // namespace cc |
| OLD | NEW |