OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TEST_PROXY_IMPL_FOR_TEST_H_ | 5 #ifndef CC_TEST_PROXY_IMPL_FOR_TEST_H_ |
6 #define CC_TEST_PROXY_IMPL_FOR_TEST_H_ | 6 #define CC_TEST_PROXY_IMPL_FOR_TEST_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "cc/test/test_hooks.h" | 9 #include "cc/test/test_hooks.h" |
10 #include "cc/trees/proxy_impl.h" | 10 #include "cc/trees/proxy_impl.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 // Creates a ProxyImpl that notifies the supplied |test_hooks| of various | 13 // Creates a ProxyImpl that notifies the supplied |test_hooks| of various |
14 // actions. | 14 // actions. |
15 class ProxyImplForTest : public ProxyImpl { | 15 class ProxyImplForTest : public ProxyImpl { |
16 public: | 16 public: |
17 static scoped_ptr<ProxyImplForTest> Create( | 17 static std::unique_ptr<ProxyImplForTest> Create( |
18 TestHooks* test_hooks, | 18 TestHooks* test_hooks, |
19 ChannelImpl* channel_impl, | 19 ChannelImpl* channel_impl, |
20 LayerTreeHost* layer_tree_host, | 20 LayerTreeHost* layer_tree_host, |
21 TaskRunnerProvider* task_runner_provider, | 21 TaskRunnerProvider* task_runner_provider, |
22 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 22 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
23 | 23 |
24 using ProxyImpl::PostAnimationEventsToMainThreadOnImplThread; | 24 using ProxyImpl::PostAnimationEventsToMainThreadOnImplThread; |
25 using ProxyImpl::DidLoseOutputSurfaceOnImplThread; | 25 using ProxyImpl::DidLoseOutputSurfaceOnImplThread; |
26 using ProxyImpl::DidCompletePageScaleAnimationOnImplThread; | 26 using ProxyImpl::DidCompletePageScaleAnimationOnImplThread; |
27 using ProxyImpl::SendBeginMainFrameNotExpectedSoon; | 27 using ProxyImpl::SendBeginMainFrameNotExpectedSoon; |
28 | 28 |
29 bool HasCommitCompletionEvent() const; | 29 bool HasCommitCompletionEvent() const; |
30 bool GetNextCommitWaitsForActivation() const; | 30 bool GetNextCommitWaitsForActivation() const; |
31 const DelayedUniqueNotifier& smoothness_priority_expiration_notifier() const { | 31 const DelayedUniqueNotifier& smoothness_priority_expiration_notifier() const { |
32 return smoothness_priority_expiration_notifier_; | 32 return smoothness_priority_expiration_notifier_; |
33 } | 33 } |
34 const BeginFrameArgs& last_begin_frame_args() const { | 34 const BeginFrameArgs& last_begin_frame_args() const { |
35 return last_begin_main_frame_args_; | 35 return last_begin_main_frame_args_; |
36 } | 36 } |
37 | 37 |
38 ProxyImplForTest(TestHooks* test_hooks, | 38 ProxyImplForTest( |
39 ChannelImpl* channel_impl, | 39 TestHooks* test_hooks, |
40 LayerTreeHost* layer_tree_host, | 40 ChannelImpl* channel_impl, |
41 TaskRunnerProvider* task_runner_provider, | 41 LayerTreeHost* layer_tree_host, |
42 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 42 TaskRunnerProvider* task_runner_provider, |
| 43 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
43 | 44 |
44 void ScheduledActionSendBeginMainFrame(const BeginFrameArgs& args) override; | 45 void ScheduledActionSendBeginMainFrame(const BeginFrameArgs& args) override; |
45 DrawResult ScheduledActionDrawAndSwapIfPossible() override; | 46 DrawResult ScheduledActionDrawAndSwapIfPossible() override; |
46 void ScheduledActionCommit() override; | 47 void ScheduledActionCommit() override; |
47 void ScheduledActionBeginOutputSurfaceCreation() override; | 48 void ScheduledActionBeginOutputSurfaceCreation() override; |
48 void ScheduledActionPrepareTiles() override; | 49 void ScheduledActionPrepareTiles() override; |
49 void ScheduledActionInvalidateOutputSurface() override; | 50 void ScheduledActionInvalidateOutputSurface() override; |
50 void SendBeginMainFrameNotExpectedSoon() override; | 51 void SendBeginMainFrameNotExpectedSoon() override; |
51 void DidActivateSyncTree() override; | 52 void DidActivateSyncTree() override; |
52 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override; | 53 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override; |
(...skipping 16 matching lines...) Expand all Loading... |
69 LayerTreeHost* layer_tree_host, | 70 LayerTreeHost* layer_tree_host, |
70 base::TimeTicks main_thread_start_time, | 71 base::TimeTicks main_thread_start_time, |
71 bool hold_commit_for_activation) override; | 72 bool hold_commit_for_activation) override; |
72 | 73 |
73 TestHooks* test_hooks_; | 74 TestHooks* test_hooks_; |
74 }; | 75 }; |
75 | 76 |
76 } // namespace cc | 77 } // namespace cc |
77 | 78 |
78 #endif // CC_TEST_PROXY_IMPL_FOR_TEST_H_ | 79 #endif // CC_TEST_PROXY_IMPL_FOR_TEST_H_ |
OLD | NEW |