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

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

Issue 2661523003: cc: Merge LayerTree into the LayerTreeHost. (Closed)
Patch Set: auto Created 3 years, 10 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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