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_TREES_CHANNEL_MAIN_H_ | 5 #ifndef CC_TREES_CHANNEL_MAIN_H_ |
6 #define CC_TREES_CHANNEL_MAIN_H_ | 6 #define CC_TREES_CHANNEL_MAIN_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "cc/base/completion_event.h" | 9 #include "cc/base/completion_event.h" |
10 #include "cc/input/top_controls_state.h" | 10 #include "cc/input/top_controls_state.h" |
11 #include "cc/output/output_surface.h" | 11 #include "cc/output/output_surface.h" |
12 #include "cc/scheduler/begin_frame_source.h" | |
12 #include "cc/scheduler/commit_earlyout_reason.h" | 13 #include "cc/scheduler/commit_earlyout_reason.h" |
13 #include "cc/trees/proxy_common.h" | 14 #include "cc/trees/proxy_common.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
17 | |
16 // ChannelMain and ChannelImpl provide an abstract communication layer for | 18 // ChannelMain and ChannelImpl provide an abstract communication layer for |
17 // the main and impl side of the compositor. | 19 // the main and impl side of the compositor. |
18 // | 20 // |
19 // The communication sequence between the 2 sides is: | 21 // The communication sequence between the 2 sides is: |
20 // | 22 // |
21 // LayerTreeHost<-->ProxyMain<-->ChannelMain | 23 // LayerTreeHost<-->ProxyMain<-->ChannelMain |
22 // | | 24 // | |
23 // | | 25 // | |
24 // ChannelImpl<-->ProxyImpl<-->LayerTreeHostImpl | 26 // ChannelImpl<-->ProxyImpl<-->LayerTreeHostImpl |
25 | 27 |
26 class CC_EXPORT ChannelMain { | 28 class CC_EXPORT ChannelMain { |
27 public: | 29 public: |
28 // Interface for commands sent to the ProxyImpl | 30 // Interface for commands sent to ProxyImpl |
29 virtual void SetThrottleFrameProductionOnImpl(bool throttle) = 0; | 31 virtual void SetThrottleFrameProductionOnImpl(bool throttle) = 0; |
30 virtual void UpdateTopControlsStateOnImpl(TopControlsState constraints, | 32 virtual void UpdateTopControlsStateOnImpl(TopControlsState constraints, |
31 TopControlsState current, | 33 TopControlsState current, |
32 bool animate) = 0; | 34 bool animate) = 0; |
33 virtual void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) = 0; | 35 virtual void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) = 0; |
34 virtual void MainThreadHasStoppedFlingingOnImpl() = 0; | 36 virtual void MainThreadHasStoppedFlingingOnImpl() = 0; |
35 virtual void SetInputThrottledUntilCommitOnImpl(bool is_throttled) = 0; | 37 virtual void SetInputThrottledUntilCommitOnImpl(bool is_throttled) = 0; |
36 virtual void SetDeferCommitsOnImpl(bool defer_commits) = 0; | 38 virtual void SetDeferCommitsOnImpl(bool defer_commits) = 0; |
37 virtual void FinishAllRenderingOnImpl(CompletionEvent* completion) = 0; | 39 virtual void FinishAllRenderingOnImpl(CompletionEvent* completion) = 0; |
38 virtual void SetVisibleOnImpl(bool visible) = 0; | 40 virtual void SetVisibleOnImpl(bool visible) = 0; |
39 virtual void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) = 0; | 41 virtual void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) = 0; |
40 virtual void FinishGLOnImpl(CompletionEvent* completion) = 0; | |
41 virtual void MainFrameWillHappenOnImplForTesting( | 42 virtual void MainFrameWillHappenOnImplForTesting( |
42 CompletionEvent* completion, | 43 CompletionEvent* completion, |
43 bool* main_frame_will_happen) = 0; | 44 bool* main_frame_will_happen) = 0; |
44 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) = 0; | 45 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) = 0; |
45 virtual void SetNeedsCommitOnImpl() = 0; | 46 virtual void SetNeedsCommitOnImpl() = 0; |
46 virtual void BeginMainFrameAbortedOnImpl( | 47 virtual void BeginMainFrameAbortedOnImpl( |
47 CommitEarlyOutReason reason, | 48 CommitEarlyOutReason reason, |
48 base::TimeTicks main_thread_start_time) = 0; | 49 base::TimeTicks main_thread_start_time) = 0; |
49 virtual void StartCommitOnImpl(CompletionEvent* completion, | 50 virtual void StartCommitOnImpl(CompletionEvent* completion, |
50 LayerTreeHost* layer_tree_host, | 51 LayerTreeHost* layer_tree_host, |
51 base::TimeTicks main_thread_start_time, | 52 base::TimeTicks main_thread_start_time, |
52 bool hold_commit_for_activation) = 0; | 53 bool hold_commit_for_activation) = 0; |
53 virtual void InitializeImplOnImpl(CompletionEvent* completion, | 54 |
54 LayerTreeHost* layer_tree_host) = 0; | 55 // Must be called before using the channel. |
55 virtual void LayerTreeHostClosedOnImpl(CompletionEvent* completion) = 0; | 56 virtual void SynchronouslyInitializeImpl( |
57 LayerTreeHost* layer_tree_host, | |
58 scoped_ptr<BeginFrameSource> external_begin_frame_source) = 0; | |
59 | |
60 // Must be called before deleting the channel. | |
61 virtual void SynchronouslyCloseImpl() = 0; | |
56 | 62 |
57 virtual ~ChannelMain() {} | 63 virtual ~ChannelMain() {} |
Wez
2015/11/21 01:00:29
nit: dtor should be declared before members.
Khushal
2015/11/23 20:07:19
Done.
| |
58 }; | 64 }; |
59 | 65 |
60 } // namespace cc | 66 } // namespace cc |
61 | 67 |
62 #endif // CC_TREES_CHANNEL_MAIN_H_ | 68 #endif // CC_TREES_CHANNEL_MAIN_H_ |
OLD | NEW |