OLD | NEW |
| (Empty) |
1 // Copyright 2015 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. | |
4 | |
5 #ifndef CC_TEST_PROXY_IMPL_FOR_TEST_H_ | |
6 #define CC_TEST_PROXY_IMPL_FOR_TEST_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "cc/test/test_hooks.h" | |
10 #include "cc/trees/proxy_impl.h" | |
11 | |
12 namespace cc { | |
13 // Creates a ProxyImpl that notifies the supplied |test_hooks| of various | |
14 // actions. | |
15 class ProxyImplForTest : public ProxyImpl { | |
16 public: | |
17 static scoped_ptr<ProxyImpl> Create( | |
18 TestHooks* test_hooks, | |
19 ChannelImpl* channel_impl, | |
20 LayerTreeHost* layer_tree_host, | |
21 TaskRunnerProvider* task_runner_provider, | |
22 scoped_ptr<BeginFrameSource> external_begin_frame_source); | |
23 | |
24 using ProxyImpl::PostAnimationEventsToMainThreadOnImplThread; | |
25 using ProxyImpl::DidLoseOutputSurfaceOnImplThread; | |
26 using ProxyImpl::DidCompletePageScaleAnimationOnImplThread; | |
27 using ProxyImpl::SendBeginMainFrameNotExpectedSoon; | |
28 | |
29 bool HasCommitCompletionEvent() const; | |
30 bool GetNextCommitWaitsForActivation() const; | |
31 | |
32 ProxyImplForTest(TestHooks* test_hooks, | |
33 ChannelImpl* channel_impl, | |
34 LayerTreeHost* layer_tree_host, | |
35 TaskRunnerProvider* task_runner_provider, | |
36 scoped_ptr<BeginFrameSource> external_begin_frame_source); | |
37 | |
38 void ScheduledActionSendBeginMainFrame(const BeginFrameArgs& args) override; | |
39 DrawResult ScheduledActionDrawAndSwapIfPossible() override; | |
40 void ScheduledActionCommit() override; | |
41 void ScheduledActionBeginOutputSurfaceCreation() override; | |
42 void ScheduledActionPrepareTiles() override; | |
43 void ScheduledActionInvalidateOutputSurface() override; | |
44 void SendBeginMainFrameNotExpectedSoon() override; | |
45 void DidActivateSyncTree() override; | |
46 void SetThrottleFrameProductionOnImpl(bool throttle) override; | |
47 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override; | |
48 void MainThreadHasStoppedFlingingOnImpl() override; | |
49 void SetInputThrottledUntilCommitOnImpl(bool is_throttled) override; | |
50 void UpdateTopControlsStateOnImpl(TopControlsState constraints, | |
51 TopControlsState current, | |
52 bool animate) override; | |
53 void SetDeferCommitsOnImpl(bool defer_commits) const override; | |
54 void BeginMainFrameAbortedOnImpl( | |
55 CommitEarlyOutReason reason, | |
56 base::TimeTicks main_thread_start_time) override; | |
57 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) override; | |
58 void SetNeedsCommitOnImpl() override; | |
59 void FinishAllRenderingOnImpl(CompletionEvent* completion) override; | |
60 void SetVisibleOnImpl(bool visible) override; | |
61 void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) override; | |
62 void FinishGLOnImpl(CompletionEvent* completion) override; | |
63 void StartCommitOnImpl(CompletionEvent* completion, | |
64 LayerTreeHost* layer_tree_host, | |
65 base::TimeTicks main_thread_start_time, | |
66 bool hold_commit_for_activation) override; | |
67 | |
68 TestHooks* test_hooks_; | |
69 }; | |
70 | |
71 } // namespace cc | |
72 | |
73 #endif // CC_TEST_PROXY_IMPL_FOR_TEST_H_ | |
OLD | NEW |