cleanup: Use EventRouter and some cleanups.
[chromium-blink-merge.git] / cc / test / fake_proxy.h
blob6d9113a65029d0b292f83a61cd96151b3b0a92f3
1 // Copyright 2012 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_PROXY_H_
6 #define CC_TEST_FAKE_PROXY_H_
8 #include "base/single_thread_task_runner.h"
9 #include "cc/trees/layer_tree_host.h"
10 #include "cc/trees/proxy.h"
12 namespace cc {
14 class FakeProxy : public Proxy {
15 public:
16 FakeProxy() : Proxy(NULL), layer_tree_host_(NULL) {}
17 explicit FakeProxy(
18 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
19 : Proxy(impl_task_runner),
20 layer_tree_host_(NULL) {}
22 void SetLayerTreeHost(LayerTreeHost* host);
24 virtual bool CompositeAndReadback(void* pixels,
25 const gfx::Rect& rect) OVERRIDE;
26 virtual void FinishAllRendering() OVERRIDE {}
27 virtual bool IsStarted() const OVERRIDE;
28 virtual void SetLayerTreeHostClientReady() OVERRIDE {}
29 virtual void SetVisible(bool visible) OVERRIDE {}
30 virtual void CreateAndInitializeOutputSurface() OVERRIDE;
31 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE;
32 virtual void SetNeedsAnimate() OVERRIDE {}
33 virtual void SetNeedsUpdateLayers() OVERRIDE {}
34 virtual void SetNeedsCommit() OVERRIDE {}
35 virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) OVERRIDE {}
36 virtual void SetNextCommitWaitsForActivation() OVERRIDE {}
37 virtual void NotifyInputThrottledUntilCommit() OVERRIDE {}
38 virtual void SetDeferCommits(bool defer_commits) OVERRIDE {}
39 virtual void MainThreadHasStoppedFlinging() OVERRIDE {}
40 virtual bool BeginMainFrameRequested() const OVERRIDE;
41 virtual bool CommitRequested() const OVERRIDE;
42 virtual void Start() OVERRIDE {}
43 virtual void Stop() OVERRIDE {}
44 virtual void ForceSerializeOnSwapBuffers() OVERRIDE {}
45 virtual size_t MaxPartialTextureUpdates() const OVERRIDE;
46 virtual void SetDebugState(const LayerTreeDebugState& debug_state) OVERRIDE {}
47 virtual bool CommitPendingForTesting() OVERRIDE;
48 virtual scoped_ptr<base::Value> AsValue() const OVERRIDE;
50 virtual RendererCapabilities& GetRendererCapabilities();
51 void SetMaxPartialTextureUpdates(size_t max);
53 private:
54 RendererCapabilities capabilities_;
55 size_t max_partial_texture_updates_;
56 LayerTreeHost* layer_tree_host_;
59 } // namespace cc
61 #endif // CC_TEST_FAKE_PROXY_H_