summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_layer_tree_host.cc
diff options
context:
space:
mode:
authorvmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-12 01:30:29 +0000
committervmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-12 01:30:29 +0000
commit666d7cffc8025696c6743889fcd4c9bb2980ba70 (patch)
tree3372cd68db769e6ec1649998d17ff697feadb577 /cc/test/fake_layer_tree_host.cc
parentd31c53449787ba09aaea6251d9ac878669218817 (diff)
downloadchromium_src-666d7cffc8025696c6743889fcd4c9bb2980ba70.zip
chromium_src-666d7cffc8025696c6743889fcd4c9bb2980ba70.tar.gz
chromium_src-666d7cffc8025696c6743889fcd4c9bb2980ba70.tar.bz2
cc: Add MicroBenchmarkController plumbing.
This patch adds the necessary plumbing for micro benchmark controller. The plan is as follows: - MicroBenchmarkController will live on LayerTreeHost - The schedule functionality will be exposed to gpu benchmarking extension - Javascript bindings will allow external code to schedule certain benchmarks (specified by name) to be run right after Layer::Update. R=enne@chromium.org,nduca@chromium.org Review URL: https://codereview.chromium.org/26593002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_layer_tree_host.cc')
-rw-r--r--cc/test/fake_layer_tree_host.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/cc/test/fake_layer_tree_host.cc b/cc/test/fake_layer_tree_host.cc
new file mode 100644
index 0000000..c6d92ab
--- /dev/null
+++ b/cc/test/fake_layer_tree_host.cc
@@ -0,0 +1,34 @@
+// 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.
+
+#include "cc/test/fake_layer_tree_host.h"
+
+namespace cc {
+
+scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create() {
+ static FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
+ static LayerTreeSettings settings;
+ return make_scoped_ptr(new FakeLayerTreeHost(&client, settings));
+}
+
+scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
+ const LayerTreeSettings& settings) {
+ static FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
+ return make_scoped_ptr(new FakeLayerTreeHost(&client, settings));
+}
+
+void FakeLayerTreeHost::SetNeedsCommit() { needs_commit_ = true; }
+
+LayerImpl* FakeLayerTreeHost::CommitAndCreateLayerImplTree() {
+ scoped_ptr<LayerImpl> old_root_layer_impl = active_tree()->DetachLayerTree();
+
+ scoped_ptr<LayerImpl> layer_impl = TreeSynchronizer::SynchronizeTrees(
+ root_layer(), old_root_layer_impl.Pass(), active_tree());
+ TreeSynchronizer::PushProperties(root_layer(), layer_impl.get());
+
+ active_tree()->SetRootLayer(layer_impl.Pass());
+ return active_tree()->root_layer();
+}
+
+} // namespace cc