Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: cc/debug/micro_benchmark_controller.cc

Issue 2216203002: Refactor MutatorHostClient from LayerTreeHost to LayerTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on another LTH refactor CL. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/debug/micro_benchmark.cc ('k') | cc/debug/rasterize_and_record_benchmark.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/debug/micro_benchmark.cc ('k') | cc/debug/rasterize_and_record_benchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698