OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_BLIMP_LAYER_TREE_HOST_REMOTE_H_ | 5 #ifndef CC_BLIMP_LAYER_TREE_HOST_REMOTE_H_ |
6 #define CC_BLIMP_LAYER_TREE_HOST_REMOTE_H_ | 6 #define CC_BLIMP_LAYER_TREE_HOST_REMOTE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 std::unique_ptr<base::Value> value) override; | 91 std::unique_ptr<base::Value> value) override; |
92 SurfaceSequenceGenerator* GetSurfaceSequenceGenerator() override; | 92 SurfaceSequenceGenerator* GetSurfaceSequenceGenerator() override; |
93 void SetNextCommitWaitsForActivation() override; | 93 void SetNextCommitWaitsForActivation() override; |
94 void ResetGpuRasterizationTracking() override; | 94 void ResetGpuRasterizationTracking() override; |
95 | 95 |
96 protected: | 96 protected: |
97 // Protected for testing. Allows tests to inject the LayerTree. | 97 // Protected for testing. Allows tests to inject the LayerTree. |
98 LayerTreeHostRemote(InitParams* params, | 98 LayerTreeHostRemote(InitParams* params, |
99 std::unique_ptr<LayerTree> layer_tree); | 99 std::unique_ptr<LayerTree> layer_tree); |
100 | 100 |
| 101 LayerTreeHostClient* client() const { return client_; } |
| 102 RemoteCompositorBridge* remote_compositor_bridge() const { |
| 103 return remote_compositor_bridge_.get(); |
| 104 } |
| 105 |
| 106 virtual void DispatchDrawAndSwapCallbacks(); |
| 107 void SetTaskRunnerProviderForTesting( |
| 108 std::unique_ptr<TaskRunnerProvider> task_runner_provider); |
| 109 |
| 110 // RemoteCompositorBridgeClient implementation. |
| 111 void BeginMainFrame() override; |
| 112 |
101 private: | 113 private: |
102 enum class FramePipelineStage { NONE, ANIMATE, UPDATE_LAYERS, COMMIT }; | 114 enum class FramePipelineStage { NONE, ANIMATE, UPDATE_LAYERS, COMMIT }; |
103 | 115 |
104 // RemoteCompositorBridgeClient implementation. | |
105 void BeginMainFrame() override; | |
106 | |
107 void MainFrameRequested(FramePipelineStage requested_pipeline_stage); | 116 void MainFrameRequested(FramePipelineStage requested_pipeline_stage); |
108 void ScheduleMainFrameIfNecessary(); | 117 void ScheduleMainFrameIfNecessary(); |
109 void MainFrameComplete(); | 118 void MainFrameComplete(); |
110 void DispatchDrawAndSwapCallbacks(); | |
111 void SerializeCurrentState(proto::LayerTreeHost* layer_tree_host_proto); | 119 void SerializeCurrentState(proto::LayerTreeHost* layer_tree_host_proto); |
112 | 120 |
113 const int id_; | 121 const int id_; |
114 int source_frame_number_ = 0; | 122 int source_frame_number_ = 0; |
115 bool visible_ = false; | 123 bool visible_ = false; |
116 bool defer_commits_ = false; | 124 bool defer_commits_ = false; |
117 | 125 |
118 // Set to true if a main frame request is pending on the | 126 // Set to true if a main frame request is pending on the |
119 // RemoteCompositorBridge. | 127 // RemoteCompositorBridge. |
120 bool main_frame_requested_from_bridge_ = false; | 128 bool main_frame_requested_from_bridge_ = false; |
(...skipping 27 matching lines...) Expand all Loading... |
148 SurfaceSequenceGenerator surface_sequence_generator_; | 156 SurfaceSequenceGenerator surface_sequence_generator_; |
149 | 157 |
150 base::WeakPtr<InputHandler> input_handler_weak_ptr_; | 158 base::WeakPtr<InputHandler> input_handler_weak_ptr_; |
151 | 159 |
152 base::WeakPtrFactory<LayerTreeHostRemote> weak_factory_; | 160 base::WeakPtrFactory<LayerTreeHostRemote> weak_factory_; |
153 }; | 161 }; |
154 | 162 |
155 } // namespace cc | 163 } // namespace cc |
156 | 164 |
157 #endif // CC_BLIMP_LAYER_TREE_HOST_REMOTE_H_ | 165 #endif // CC_BLIMP_LAYER_TREE_HOST_REMOTE_H_ |
OLD | NEW |