| 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_TREES_CHANNEL_MAIN_H_ | |
| 6 #define CC_TREES_CHANNEL_MAIN_H_ | |
| 7 | |
| 8 #include "cc/base/cc_export.h" | |
| 9 #include "cc/base/completion_event.h" | |
| 10 #include "cc/input/browser_controls_state.h" | |
| 11 #include "cc/output/compositor_frame_sink.h" | |
| 12 #include "cc/scheduler/begin_frame_source.h" | |
| 13 #include "cc/scheduler/commit_earlyout_reason.h" | |
| 14 #include "cc/trees/proxy_common.h" | |
| 15 | |
| 16 namespace cc { | |
| 17 class LayerTreeHostInProcess; | |
| 18 class LayerTreeMutator; | |
| 19 | |
| 20 // ChannelMain and ChannelImpl provide an abstract communication layer for | |
| 21 // the main and impl side of the compositor. | |
| 22 // | |
| 23 // The communication sequence between the 2 sides is: | |
| 24 // | |
| 25 // LayerTreeHostInProcess<-->ProxyMain<-->ChannelMain | |
| 26 // | | |
| 27 // | | |
| 28 // ChannelImpl<-->ProxyImpl<-->LayerTreeHostImpl | |
| 29 | |
| 30 class CC_EXPORT ChannelMain { | |
| 31 public: | |
| 32 virtual ~ChannelMain() {} | |
| 33 | |
| 34 // Interface for commands sent to ProxyImpl | |
| 35 virtual void UpdateBrowserControlsStateOnImpl( | |
| 36 BrowserControlsState constraints, | |
| 37 BrowserControlsState current, | |
| 38 bool animate) = 0; | |
| 39 virtual void InitializeCompositorFrameSinkOnImpl( | |
| 40 CompositorFrameSink* compositor_frame_sink) = 0; | |
| 41 virtual void InitializeMutatorOnImpl( | |
| 42 std::unique_ptr<LayerTreeMutator> mutator) = 0; | |
| 43 virtual void MainThreadHasStoppedFlingingOnImpl() = 0; | |
| 44 virtual void SetInputThrottledUntilCommitOnImpl(bool is_throttled) = 0; | |
| 45 virtual void SetDeferCommitsOnImpl(bool defer_commits) = 0; | |
| 46 virtual void SetVisibleOnImpl(bool visible) = 0; | |
| 47 virtual void ReleaseCompositorFrameSinkOnImpl( | |
| 48 CompletionEvent* completion) = 0; | |
| 49 virtual void MainFrameWillHappenOnImplForTesting( | |
| 50 CompletionEvent* completion, | |
| 51 bool* main_frame_will_happen) = 0; | |
| 52 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) = 0; | |
| 53 virtual void SetNeedsCommitOnImpl() = 0; | |
| 54 virtual void BeginMainFrameAbortedOnImpl( | |
| 55 CommitEarlyOutReason reason, | |
| 56 base::TimeTicks main_thread_start_time, | |
| 57 std::vector<std::unique_ptr<SwapPromise>> swap_promises) = 0; | |
| 58 virtual void NotifyReadyToCommitOnImpl( | |
| 59 CompletionEvent* completion, | |
| 60 LayerTreeHostInProcess* layer_tree_host, | |
| 61 base::TimeTicks main_thread_start_time, | |
| 62 bool hold_commit_for_activation) = 0; | |
| 63 | |
| 64 // Must be called before using the channel. | |
| 65 virtual void SynchronouslyInitializeImpl( | |
| 66 LayerTreeHostInProcess* layer_tree_host) = 0; | |
| 67 | |
| 68 // Must be called before deleting the channel. | |
| 69 virtual void SynchronouslyCloseImpl() = 0; | |
| 70 }; | |
| 71 | |
| 72 } // namespace cc | |
| 73 | |
| 74 #endif // CC_TREES_CHANNEL_MAIN_H_ | |
| OLD | NEW |