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/compositor_frame_sink.h" | 11 #include "cc/output/compositor_frame_sink.h" |
12 #include "cc/scheduler/begin_frame_source.h" | 12 #include "cc/scheduler/begin_frame_source.h" |
13 #include "cc/scheduler/commit_earlyout_reason.h" | 13 #include "cc/scheduler/commit_earlyout_reason.h" |
14 #include "cc/trees/proxy_common.h" | 14 #include "cc/trees/proxy_common.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 | 17 class LayerTreeHostInProcess; |
18 class LayerTreeMutator; | 18 class LayerTreeMutator; |
19 | 19 |
20 // ChannelMain and ChannelImpl provide an abstract communication layer for | 20 // ChannelMain and ChannelImpl provide an abstract communication layer for |
21 // the main and impl side of the compositor. | 21 // the main and impl side of the compositor. |
22 // | 22 // |
23 // The communication sequence between the 2 sides is: | 23 // The communication sequence between the 2 sides is: |
24 // | 24 // |
25 // LayerTreeHost<-->ProxyMain<-->ChannelMain | 25 // LayerTreeHostInProcess<-->ProxyMain<-->ChannelMain |
26 // | | 26 // | |
27 // | | 27 // | |
28 // ChannelImpl<-->ProxyImpl<-->LayerTreeHostImpl | 28 // ChannelImpl<-->ProxyImpl<-->LayerTreeHostImpl |
29 | 29 |
30 class CC_EXPORT ChannelMain { | 30 class CC_EXPORT ChannelMain { |
31 public: | 31 public: |
32 virtual ~ChannelMain() {} | 32 virtual ~ChannelMain() {} |
33 | 33 |
34 // Interface for commands sent to ProxyImpl | 34 // Interface for commands sent to ProxyImpl |
35 virtual void UpdateTopControlsStateOnImpl(TopControlsState constraints, | 35 virtual void UpdateTopControlsStateOnImpl(TopControlsState constraints, |
(...skipping 11 matching lines...) Expand all Loading... |
47 CompletionEvent* completion) = 0; | 47 CompletionEvent* completion) = 0; |
48 virtual void MainFrameWillHappenOnImplForTesting( | 48 virtual void MainFrameWillHappenOnImplForTesting( |
49 CompletionEvent* completion, | 49 CompletionEvent* completion, |
50 bool* main_frame_will_happen) = 0; | 50 bool* main_frame_will_happen) = 0; |
51 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) = 0; | 51 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) = 0; |
52 virtual void SetNeedsCommitOnImpl() = 0; | 52 virtual void SetNeedsCommitOnImpl() = 0; |
53 virtual void BeginMainFrameAbortedOnImpl( | 53 virtual void BeginMainFrameAbortedOnImpl( |
54 CommitEarlyOutReason reason, | 54 CommitEarlyOutReason reason, |
55 base::TimeTicks main_thread_start_time, | 55 base::TimeTicks main_thread_start_time, |
56 std::vector<std::unique_ptr<SwapPromise>> swap_promises) = 0; | 56 std::vector<std::unique_ptr<SwapPromise>> swap_promises) = 0; |
57 virtual void NotifyReadyToCommitOnImpl(CompletionEvent* completion, | 57 virtual void NotifyReadyToCommitOnImpl( |
58 LayerTreeHost* layer_tree_host, | 58 CompletionEvent* completion, |
59 base::TimeTicks main_thread_start_time, | 59 LayerTreeHostInProcess* layer_tree_host, |
60 bool hold_commit_for_activation) = 0; | 60 base::TimeTicks main_thread_start_time, |
| 61 bool hold_commit_for_activation) = 0; |
61 | 62 |
62 // Must be called before using the channel. | 63 // Must be called before using the channel. |
63 virtual void SynchronouslyInitializeImpl( | 64 virtual void SynchronouslyInitializeImpl( |
64 LayerTreeHost* layer_tree_host, | 65 LayerTreeHostInProcess* layer_tree_host, |
65 std::unique_ptr<BeginFrameSource> external_begin_frame_source) = 0; | 66 std::unique_ptr<BeginFrameSource> external_begin_frame_source) = 0; |
66 | 67 |
67 // Must be called before deleting the channel. | 68 // Must be called before deleting the channel. |
68 virtual void SynchronouslyCloseImpl() = 0; | 69 virtual void SynchronouslyCloseImpl() = 0; |
69 }; | 70 }; |
70 | 71 |
71 } // namespace cc | 72 } // namespace cc |
72 | 73 |
73 #endif // CC_TREES_CHANNEL_MAIN_H_ | 74 #endif // CC_TREES_CHANNEL_MAIN_H_ |
OLD | NEW |