summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_proxy.h
blob: b908b037ed93c56053737274f4fc0c9487fc6a51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright 2012 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_TEST_FAKE_PROXY_H_
#define CC_TEST_FAKE_PROXY_H_

#include "base/single_thread_task_runner.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/proxy.h"

namespace cc {

class FakeProxy : public Proxy {
 public:
  FakeProxy() : Proxy(NULL, NULL), layer_tree_host_(NULL) {}
  explicit FakeProxy(
      scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
      scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
      : Proxy(main_task_runner, impl_task_runner), layer_tree_host_(NULL) {}

  void SetLayerTreeHost(LayerTreeHost* host);

  void FinishAllRendering() override {}
  bool IsStarted() const override;
  bool CommitToActiveTree() const override;
  void SetOutputSurface(scoped_ptr<OutputSurface>) override {}
  void SetLayerTreeHostClientReady() override {}
  void SetVisible(bool visible) override {}
  void SetThrottleFrameProduction(bool throttle) override {}
  const RendererCapabilities& GetRendererCapabilities() const override;
  void SetNeedsAnimate() override {}
  void SetNeedsUpdateLayers() override {}
  void SetNeedsCommit() override {}
  void SetNeedsRedraw(const gfx::Rect& damage_rect) override {}
  void SetNextCommitWaitsForActivation() override {}
  void NotifyInputThrottledUntilCommit() override {}
  void SetDeferCommits(bool defer_commits) override {}
  void MainThreadHasStoppedFlinging() override {}
  bool BeginMainFrameRequested() const override;
  bool CommitRequested() const override;
  void Start() override {}
  void Stop() override {}
  void ForceSerializeOnSwapBuffers() override {}
  bool SupportsImplScrolling() const override;
  void SetDebugState(const LayerTreeDebugState& debug_state) override {}
  bool MainFrameWillHappenForTesting() override;
  void SetChildrenNeedBeginFrames(bool children_need_begin_frames) override {}
  void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval) override {
  }

  virtual RendererCapabilities& GetRendererCapabilities();

 private:
  RendererCapabilities capabilities_;
  LayerTreeHost* layer_tree_host_;
};

}  // namespace cc

#endif  // CC_TEST_FAKE_PROXY_H_