Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / cc / test / fake_layer_tree_host.h
blob05fefc3462206b91d79cc4156219611c1af0a307
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
3 // found in the LICENSE file.
5 #ifndef CC_TEST_FAKE_LAYER_TREE_HOST_H_
6 #define CC_TEST_FAKE_LAYER_TREE_HOST_H_
8 #include "cc/debug/micro_benchmark_controller.h"
9 #include "cc/test/fake_impl_proxy.h"
10 #include "cc/test/fake_layer_tree_host_client.h"
11 #include "cc/test/fake_layer_tree_host_impl.h"
12 #include "cc/test/test_shared_bitmap_manager.h"
13 #include "cc/trees/layer_tree_host.h"
14 #include "cc/trees/layer_tree_impl.h"
15 #include "cc/trees/tree_synchronizer.h"
17 namespace cc {
19 class FakeLayerTreeHost : public LayerTreeHost {
20 public:
21 static scoped_ptr<FakeLayerTreeHost> Create();
23 static scoped_ptr<FakeLayerTreeHost> Create(
24 const LayerTreeSettings& settings);
26 virtual ~FakeLayerTreeHost() {}
28 virtual void SetNeedsCommit() OVERRIDE;
29 virtual void SetNeedsFullTreeSync() OVERRIDE {}
31 using LayerTreeHost::SetRootLayer;
32 using LayerTreeHost::root_layer;
34 LayerImpl* CommitAndCreateLayerImplTree();
36 FakeLayerTreeHostImpl* host_impl() { return &host_impl_; }
37 LayerTreeImpl* active_tree() { return host_impl_.active_tree(); }
39 using LayerTreeHost::ScheduleMicroBenchmark;
40 using LayerTreeHost::SetOutputSurfaceLostForTesting;
41 using LayerTreeHost::InitializeSingleThreaded;
42 using LayerTreeHost::InitializeForTesting;
43 void UpdateLayers(ResourceUpdateQueue* queue) {
44 LayerTreeHost::UpdateLayers(queue);
47 MicroBenchmarkController* GetMicroBenchmarkController() {
48 return &micro_benchmark_controller_;
51 bool needs_commit() { return needs_commit_; }
53 private:
54 FakeLayerTreeHost(LayerTreeHostClient* client,
55 const LayerTreeSettings& settings);
57 FakeImplProxy proxy_;
58 TestSharedBitmapManager manager_;
59 FakeLayerTreeHostImpl host_impl_;
60 bool needs_commit_;
63 } // namespace cc
65 #endif // CC_TEST_FAKE_LAYER_TREE_HOST_H_