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_THREADED_CHANNEL_H_ | 5 #ifndef CC_TREES_THREADED_CHANNEL_H_ |
6 #define CC_TREES_THREADED_CHANNEL_H_ | 6 #define CC_TREES_THREADED_CHANNEL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // --------------------------------------------------------------------------- | 43 // --------------------------------------------------------------------------- |
44 // ChannelMain::SynchronouslyInitializeImpl ---PostTask---> ThreadedChannel:: | 44 // ChannelMain::SynchronouslyInitializeImpl ---PostTask---> ThreadedChannel:: |
45 // InitializeImplOnImpl | 45 // InitializeImplOnImpl |
46 // | | 46 // | |
47 // ProxyImpl::Create | 47 // ProxyImpl::Create |
48 // | | 48 // | |
49 // ProxyImpl->Initialize() | 49 // ProxyImpl->Initialize() |
50 // . | 50 // . |
51 // . | 51 // . |
52 // ProxyImpl::ScheduledActionBegin | 52 // ProxyImpl::ScheduledActionBegin |
53 // OutputSurfaceCreation | 53 // CompositorFrameSinkCreation |
54 // | | 54 // | |
55 // ChannelImpl::RequestNewOutputSurface | 55 // ChannelImpl::RequestNewCompositorFrameSink |
56 // ---------------------------------------------------------------------------- | 56 // ---------------------------------------------------------------------------- |
57 // | | 57 // | |
58 // ProxyMain->RequestNewOutputSurface()<----PostTask-------- | 58 // ProxyMain->RequestNewCompositorFrameSink()<----PostTask-------- |
59 // . | 59 // . |
60 // . | 60 // . |
61 // ProxyMain->Stop() | 61 // ProxyMain->Stop() |
62 // | | 62 // | |
63 // --------------------------------------------------------------------------- | 63 // --------------------------------------------------------------------------- |
64 // ChannelMain::SynchronouslyCloseImpl ---PostTask---> ThreadedChannel:: | 64 // ChannelMain::SynchronouslyCloseImpl ---PostTask---> ThreadedChannel:: |
65 // CloseImplOnImpl | 65 // CloseImplOnImpl |
66 // ---------------------------------------------------------------------------- | 66 // ---------------------------------------------------------------------------- |
67 // | 67 // |
68 // ThreadedChannel is created and destroyed on the main thread but can be | 68 // ThreadedChannel is created and destroyed on the main thread but can be |
(...skipping 11 matching lines...) Expand all Loading... |
80 static std::unique_ptr<ThreadedChannel> Create( | 80 static std::unique_ptr<ThreadedChannel> Create( |
81 ProxyMain* proxy_main, | 81 ProxyMain* proxy_main, |
82 TaskRunnerProvider* task_runner_provider); | 82 TaskRunnerProvider* task_runner_provider); |
83 | 83 |
84 ~ThreadedChannel() override; | 84 ~ThreadedChannel() override; |
85 | 85 |
86 // ChannelMain Implementation | 86 // ChannelMain Implementation |
87 void UpdateTopControlsStateOnImpl(TopControlsState constraints, | 87 void UpdateTopControlsStateOnImpl(TopControlsState constraints, |
88 TopControlsState current, | 88 TopControlsState current, |
89 bool animate) override; | 89 bool animate) override; |
90 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override; | 90 void InitializeCompositorFrameSinkOnImpl( |
| 91 CompositorFrameSink* output_surface) override; |
91 void InitializeMutatorOnImpl( | 92 void InitializeMutatorOnImpl( |
92 std::unique_ptr<LayerTreeMutator> mutator) override; | 93 std::unique_ptr<LayerTreeMutator> mutator) override; |
93 void MainThreadHasStoppedFlingingOnImpl() override; | 94 void MainThreadHasStoppedFlingingOnImpl() override; |
94 void SetInputThrottledUntilCommitOnImpl(bool is_throttled) override; | 95 void SetInputThrottledUntilCommitOnImpl(bool is_throttled) override; |
95 void SetDeferCommitsOnImpl(bool defer_commits) override; | 96 void SetDeferCommitsOnImpl(bool defer_commits) override; |
96 void SetNeedsCommitOnImpl() override; | 97 void SetNeedsCommitOnImpl() override; |
97 void BeginMainFrameAbortedOnImpl( | 98 void BeginMainFrameAbortedOnImpl( |
98 CommitEarlyOutReason reason, | 99 CommitEarlyOutReason reason, |
99 base::TimeTicks main_thread_start_time, | 100 base::TimeTicks main_thread_start_time, |
100 std::vector<std::unique_ptr<SwapPromise>> swap_promises) override; | 101 std::vector<std::unique_ptr<SwapPromise>> swap_promises) override; |
101 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) override; | 102 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) override; |
102 void SetVisibleOnImpl(bool visible) override; | 103 void SetVisibleOnImpl(bool visible) override; |
103 | 104 |
104 // Blocking calls to ProxyImpl | 105 // Blocking calls to ProxyImpl |
105 void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) override; | 106 void ReleaseCompositorFrameSinkOnImpl(CompletionEvent* completion) override; |
106 void MainFrameWillHappenOnImplForTesting( | 107 void MainFrameWillHappenOnImplForTesting( |
107 CompletionEvent* completion, | 108 CompletionEvent* completion, |
108 bool* main_frame_will_happen) override; | 109 bool* main_frame_will_happen) override; |
109 void NotifyReadyToCommitOnImpl(CompletionEvent* completion, | 110 void NotifyReadyToCommitOnImpl(CompletionEvent* completion, |
110 LayerTreeHost* layer_tree_host, | 111 LayerTreeHost* layer_tree_host, |
111 base::TimeTicks main_thread_start_time, | 112 base::TimeTicks main_thread_start_time, |
112 bool hold_commit_for_activation) override; | 113 bool hold_commit_for_activation) override; |
113 void SynchronouslyInitializeImpl( | 114 void SynchronouslyInitializeImpl( |
114 LayerTreeHost* layer_tree_host, | 115 LayerTreeHost* layer_tree_host, |
115 std::unique_ptr<BeginFrameSource> external_begin_frame_source) override; | 116 std::unique_ptr<BeginFrameSource> external_begin_frame_source) override; |
116 void SynchronouslyCloseImpl() override; | 117 void SynchronouslyCloseImpl() override; |
117 | 118 |
118 // ChannelImpl Implementation | 119 // ChannelImpl Implementation |
119 void DidCompleteSwapBuffers() override; | 120 void DidCompleteSwapBuffers() override; |
120 void BeginMainFrameNotExpectedSoon() override; | 121 void BeginMainFrameNotExpectedSoon() override; |
121 void DidCommitAndDrawFrame() override; | 122 void DidCommitAndDrawFrame() override; |
122 void SetAnimationEvents(std::unique_ptr<AnimationEvents> events) override; | 123 void SetAnimationEvents(std::unique_ptr<AnimationEvents> events) override; |
123 void DidLoseOutputSurface() override; | 124 void DidLoseCompositorFrameSink() override; |
124 void RequestNewOutputSurface() override; | 125 void RequestNewCompositorFrameSink() override; |
125 void DidInitializeOutputSurface(bool success) override; | 126 void DidInitializeCompositorFrameSink(bool success) override; |
126 void DidCompletePageScaleAnimation() override; | 127 void DidCompletePageScaleAnimation() override; |
127 void BeginMainFrame(std::unique_ptr<BeginMainFrameAndCommitState> | 128 void BeginMainFrame(std::unique_ptr<BeginMainFrameAndCommitState> |
128 begin_main_frame_state) override; | 129 begin_main_frame_state) override; |
129 | 130 |
130 protected: | 131 protected: |
131 ThreadedChannel(ProxyMain* proxy_main, | 132 ThreadedChannel(ProxyMain* proxy_main, |
132 TaskRunnerProvider* task_runner_provider); | 133 TaskRunnerProvider* task_runner_provider); |
133 | 134 |
134 // Virtual for testing. | 135 // Virtual for testing. |
135 virtual std::unique_ptr<ProxyImpl> CreateProxyImpl( | 136 virtual std::unique_ptr<ProxyImpl> CreateProxyImpl( |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // Used on the main thread to safely queue calls to ProxyImpl to be run on the | 203 // Used on the main thread to safely queue calls to ProxyImpl to be run on the |
203 // impl thread. | 204 // impl thread. |
204 base::WeakPtr<ProxyImpl> proxy_impl_weak_ptr_; | 205 base::WeakPtr<ProxyImpl> proxy_impl_weak_ptr_; |
205 | 206 |
206 DISALLOW_COPY_AND_ASSIGN(ThreadedChannel); | 207 DISALLOW_COPY_AND_ASSIGN(ThreadedChannel); |
207 }; | 208 }; |
208 | 209 |
209 } // namespace cc | 210 } // namespace cc |
210 | 211 |
211 #endif // CC_TREES_THREADED_CHANNEL_H_ | 212 #endif // CC_TREES_THREADED_CHANNEL_H_ |
OLD | NEW |