Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Side by Side Diff: cc/trees/proxy_impl.h

Issue 2650303002: cc: Remove the LayerTreeHost abstraction. (Closed)
Patch Set: missed ui Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_unittest_scroll.cc ('k') | cc/trees/proxy_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_PROXY_IMPL_H_ 5 #ifndef CC_TREES_PROXY_IMPL_H_
6 #define CC_TREES_PROXY_IMPL_H_ 6 #define CC_TREES_PROXY_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "cc/base/completion_event.h" 12 #include "cc/base/completion_event.h"
13 #include "cc/base/delayed_unique_notifier.h" 13 #include "cc/base/delayed_unique_notifier.h"
14 #include "cc/input/browser_controls_state.h" 14 #include "cc/input/browser_controls_state.h"
15 #include "cc/scheduler/scheduler.h" 15 #include "cc/scheduler/scheduler.h"
16 #include "cc/trees/layer_tree_host_impl.h" 16 #include "cc/trees/layer_tree_host_impl.h"
17 17
18 namespace cc { 18 namespace cc {
19 class LayerTreeHostInProcess; 19 class LayerTreeHost;
20 class ProxyMain; 20 class ProxyMain;
21 21
22 // This class aggregates all the interactions that the main side of the 22 // This class aggregates all the interactions that the main side of the
23 // compositor needs to have with the impl side. 23 // compositor needs to have with the impl side.
24 // The class is created and lives on the impl thread. 24 // The class is created and lives on the impl thread.
25 class CC_EXPORT ProxyImpl : public NON_EXPORTED_BASE(LayerTreeHostImplClient), 25 class CC_EXPORT ProxyImpl : public NON_EXPORTED_BASE(LayerTreeHostImplClient),
26 public NON_EXPORTED_BASE(SchedulerClient) { 26 public NON_EXPORTED_BASE(SchedulerClient) {
27 public: 27 public:
28 ProxyImpl(base::WeakPtr<ProxyMain> proxy_main_weak_ptr, 28 ProxyImpl(base::WeakPtr<ProxyMain> proxy_main_weak_ptr,
29 LayerTreeHostInProcess* layer_tree_host, 29 LayerTreeHost* layer_tree_host,
30 TaskRunnerProvider* task_runner_provider); 30 TaskRunnerProvider* task_runner_provider);
31 ~ProxyImpl() override; 31 ~ProxyImpl() override;
32 32
33 void UpdateBrowserControlsStateOnImpl(BrowserControlsState constraints, 33 void UpdateBrowserControlsStateOnImpl(BrowserControlsState constraints,
34 BrowserControlsState current, 34 BrowserControlsState current,
35 bool animate); 35 bool animate);
36 void InitializeCompositorFrameSinkOnImpl( 36 void InitializeCompositorFrameSinkOnImpl(
37 CompositorFrameSink* compositor_frame_sink); 37 CompositorFrameSink* compositor_frame_sink);
38 void InitializeMutatorOnImpl(std::unique_ptr<LayerTreeMutator> mutator); 38 void InitializeMutatorOnImpl(std::unique_ptr<LayerTreeMutator> mutator);
39 void MainThreadHasStoppedFlingingOnImpl(); 39 void MainThreadHasStoppedFlingingOnImpl();
40 void SetInputThrottledUntilCommitOnImpl(bool is_throttled); 40 void SetInputThrottledUntilCommitOnImpl(bool is_throttled);
41 void SetDeferCommitsOnImpl(bool defer_commits) const; 41 void SetDeferCommitsOnImpl(bool defer_commits) const;
42 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect); 42 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect);
43 void SetNeedsCommitOnImpl(); 43 void SetNeedsCommitOnImpl();
44 void BeginMainFrameAbortedOnImpl( 44 void BeginMainFrameAbortedOnImpl(
45 CommitEarlyOutReason reason, 45 CommitEarlyOutReason reason,
46 base::TimeTicks main_thread_start_time, 46 base::TimeTicks main_thread_start_time,
47 std::vector<std::unique_ptr<SwapPromise>> swap_promises); 47 std::vector<std::unique_ptr<SwapPromise>> swap_promises);
48 void SetVisibleOnImpl(bool visible); 48 void SetVisibleOnImpl(bool visible);
49 void ReleaseCompositorFrameSinkOnImpl(CompletionEvent* completion); 49 void ReleaseCompositorFrameSinkOnImpl(CompletionEvent* completion);
50 void FinishGLOnImpl(CompletionEvent* completion); 50 void FinishGLOnImpl(CompletionEvent* completion);
51 void NotifyReadyToCommitOnImpl(CompletionEvent* completion, 51 void NotifyReadyToCommitOnImpl(CompletionEvent* completion,
52 LayerTreeHostInProcess* layer_tree_host, 52 LayerTreeHost* layer_tree_host,
53 base::TimeTicks main_thread_start_time, 53 base::TimeTicks main_thread_start_time,
54 bool hold_commit_for_activation); 54 bool hold_commit_for_activation);
55 55
56 void MainFrameWillHappenOnImplForTesting(CompletionEvent* completion, 56 void MainFrameWillHappenOnImplForTesting(CompletionEvent* completion,
57 bool* main_frame_will_happen); 57 bool* main_frame_will_happen);
58 58
59 private: 59 private:
60 // The members of this struct should be accessed on the impl thread only when 60 // The members of this struct should be accessed on the impl thread only when
61 // the main thread is blocked for a commit. 61 // the main thread is blocked for a commit.
62 struct BlockedMainCommitOnly { 62 struct BlockedMainCommitOnly {
63 BlockedMainCommitOnly(); 63 BlockedMainCommitOnly();
64 ~BlockedMainCommitOnly(); 64 ~BlockedMainCommitOnly();
65 LayerTreeHostInProcess* layer_tree_host; 65 LayerTreeHost* layer_tree_host;
66 }; 66 };
67 67
68 // LayerTreeHostImplClient implementation 68 // LayerTreeHostImplClient implementation
69 void DidLoseCompositorFrameSinkOnImplThread() override; 69 void DidLoseCompositorFrameSinkOnImplThread() override;
70 void SetBeginFrameSource(BeginFrameSource* source) override; 70 void SetBeginFrameSource(BeginFrameSource* source) override;
71 void DidReceiveCompositorFrameAckOnImplThread() override; 71 void DidReceiveCompositorFrameAckOnImplThread() override;
72 void OnCanDrawStateChanged(bool can_draw) override; 72 void OnCanDrawStateChanged(bool can_draw) override;
73 void NotifyReadyToActivate() override; 73 void NotifyReadyToActivate() override;
74 void NotifyReadyToDraw() override; 74 void NotifyReadyToDraw() override;
75 // Please call these 2 functions through 75 // Please call these 2 functions through
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 // Used to post tasks to ProxyMain on the main thread. 145 // Used to post tasks to ProxyMain on the main thread.
146 base::WeakPtr<ProxyMain> proxy_main_weak_ptr_; 146 base::WeakPtr<ProxyMain> proxy_main_weak_ptr_;
147 147
148 DISALLOW_COPY_AND_ASSIGN(ProxyImpl); 148 DISALLOW_COPY_AND_ASSIGN(ProxyImpl);
149 }; 149 };
150 150
151 } // namespace cc 151 } // namespace cc
152 152
153 #endif // CC_TREES_PROXY_IMPL_H_ 153 #endif // CC_TREES_PROXY_IMPL_H_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_scroll.cc ('k') | cc/trees/proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698