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

Unified Diff: cc/debug/micro_benchmark_controller.cc

Issue 67563002: cc: Plumbing for impl thread micro benchmarks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: speculative fix Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/debug/micro_benchmark_controller.h ('k') | cc/debug/micro_benchmark_controller_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/micro_benchmark_controller.cc
diff --git a/cc/debug/micro_benchmark_controller.cc b/cc/debug/micro_benchmark_controller.cc
index 6e34e481698a0b0e7055848f7032153e5a2a932f..52e91aea178da2e9a9e6844a203364c1d5ac805a 100644
--- a/cc/debug/micro_benchmark_controller.cc
+++ b/cc/debug/micro_benchmark_controller.cc
@@ -7,10 +7,12 @@
#include <string>
#include "base/callback.h"
+#include "base/message_loop/message_loop_proxy.h"
#include "base/values.h"
#include "cc/debug/picture_record_benchmark.h"
#include "cc/debug/unittest_only_benchmark.h"
#include "cc/trees/layer_tree_host.h"
+#include "cc/trees/layer_tree_host_impl.h"
namespace cc {
@@ -43,7 +45,8 @@ class IsDonePredicate {
} // namespace
MicroBenchmarkController::MicroBenchmarkController(LayerTreeHost* host)
- : host_(host) {
+ : host_(host),
+ main_controller_message_loop_(base::MessageLoopProxy::current().get()) {
DCHECK(host_);
}
@@ -63,12 +66,28 @@ bool MicroBenchmarkController::ScheduleRun(
return false;
}
+void MicroBenchmarkController::ScheduleImplBenchmarks(
+ LayerTreeHostImpl* host_impl) {
+ for (ScopedPtrVector<MicroBenchmark>::iterator it = benchmarks_.begin();
+ it != benchmarks_.end();
+ ++it) {
+ scoped_ptr<MicroBenchmarkImpl> benchmark_impl;
+ if (!(*it)->ProcessedForBenchmarkImpl()) {
+ benchmark_impl =
+ (*it)->GetBenchmarkImpl(main_controller_message_loop_);
+ }
+
+ if (benchmark_impl.get())
+ host_impl->ScheduleMicroBenchmark(benchmark_impl.Pass());
+ }
+}
+
void MicroBenchmarkController::DidUpdateLayers() {
for (ScopedPtrVector<MicroBenchmark>::iterator it = benchmarks_.begin();
it != benchmarks_.end();
++it) {
- DCHECK(!(*it)->IsDone());
- (*it)->DidUpdateLayers(host_);
+ if (!(*it)->IsDone())
+ (*it)->DidUpdateLayers(host_);
}
CleanUpFinishedBenchmarks();
« no previous file with comments | « cc/debug/micro_benchmark_controller.h ('k') | cc/debug/micro_benchmark_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698