diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 00:39:33 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 00:39:33 +0000 |
commit | 5e5648a485b255d82e1e28912d5f32189d442605 (patch) | |
tree | 2c37711d934c1ff4d02fbd49c66afebfdb0b1191 /cc/debug/micro_benchmark_controller_impl.h | |
parent | 9b4b393f4600baacf1afbf8f5f66096732c219ff (diff) | |
download | chromium_src-5e5648a485b255d82e1e28912d5f32189d442605.zip chromium_src-5e5648a485b255d82e1e28912d5f32189d442605.tar.gz chromium_src-5e5648a485b255d82e1e28912d5f32189d442605.tar.bz2 |
cc: Plumbing for impl thread micro benchmarks
This patch adds plumbing for running micro benchmarks on the impl
thread. The concept is as follows:
- Create a main thread benchmark via gpu benchmarking extension
- On commit complete, if the benchmark provides an impl thread
benchmark, it is created and scheduled to be run on the impl thread
- Impl thread benchmarks are run after an appropriate callback
- Impl thread benchmarks post a done callback (with results) that is
run on the main thread
- The main thread benchmark gets the callback and posts its own done
callback (with aggregated results)
- This gets back to the gpu benchmarking extension which sends the
response back to the caller
R=enne@chromium.org, nduca@chromium.org
Review URL: https://codereview.chromium.org/67563002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/debug/micro_benchmark_controller_impl.h')
-rw-r--r-- | cc/debug/micro_benchmark_controller_impl.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/cc/debug/micro_benchmark_controller_impl.h b/cc/debug/micro_benchmark_controller_impl.h new file mode 100644 index 0000000..734bf63 --- /dev/null +++ b/cc/debug/micro_benchmark_controller_impl.h @@ -0,0 +1,37 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_IMPL_H_ +#define CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_IMPL_H_ + +#include <string> + +#include "base/basictypes.h" +#include "cc/base/scoped_ptr_vector.h" +#include "cc/debug/micro_benchmark_impl.h" + +namespace cc { + +class LayerTreeHostImpl; +class CC_EXPORT MicroBenchmarkControllerImpl { + public: + explicit MicroBenchmarkControllerImpl(LayerTreeHostImpl* host); + ~MicroBenchmarkControllerImpl(); + + void DidCompleteCommit(); + + void ScheduleRun(scoped_ptr<MicroBenchmarkImpl> benchmark); + + private: + void CleanUpFinishedBenchmarks(); + + LayerTreeHostImpl* host_; + ScopedPtrVector<MicroBenchmarkImpl> benchmarks_; + + DISALLOW_COPY_AND_ASSIGN(MicroBenchmarkControllerImpl); +}; + +} // namespace cc + +#endif // CC_DEBUG_MICRO_BENCHMARK_CONTROLLER_IMPL_H_ |