| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 int ScheduleMicroBenchmark( | 88 int ScheduleMicroBenchmark( |
| 89 const std::string& benchmark_name, | 89 const std::string& benchmark_name, |
| 90 std::unique_ptr<base::Value> value, | 90 std::unique_ptr<base::Value> value, |
| 91 const MicroBenchmark::DoneCallback& callback) override; | 91 const MicroBenchmark::DoneCallback& callback) override; |
| 92 bool SendMessageToMicroBenchmark(int id, | 92 bool SendMessageToMicroBenchmark(int id, |
| 93 std::unique_ptr<base::Value> value) override; | 93 std::unique_ptr<base::Value> value) override; |
| 94 SurfaceSequenceGenerator* GetSurfaceSequenceGenerator() override; | 94 SurfaceSequenceGenerator* GetSurfaceSequenceGenerator() override; |
| 95 void SetNextCommitWaitsForActivation() override; | 95 void SetNextCommitWaitsForActivation() override; |
| 96 void ResetGpuRasterizationTracking() override; | 96 void ResetGpuRasterizationTracking() override; |
| 97 | 97 |
| 98 // RemoteCompositorBridgeClient implementation. |
| 99 void BeginMainFrame() override; |
| 100 void ApplyStateUpdateFromClient( |
| 101 const proto::ClientStateUpdate& client_state_update) override; |
| 102 |
| 98 protected: | 103 protected: |
| 99 // Protected for testing. Allows tests to inject the LayerTree. | 104 // Protected for testing. Allows tests to inject the LayerTree. |
| 100 LayerTreeHostRemote(InitParams* params, | 105 LayerTreeHostRemote(InitParams* params, |
| 101 std::unique_ptr<LayerTree> layer_tree); | 106 std::unique_ptr<LayerTree> layer_tree); |
| 102 | 107 |
| 103 LayerTreeHostClient* client() const { return client_; } | 108 LayerTreeHostClient* client() const { return client_; } |
| 104 RemoteCompositorBridge* remote_compositor_bridge() const { | 109 RemoteCompositorBridge* remote_compositor_bridge() const { |
| 105 return remote_compositor_bridge_.get(); | 110 return remote_compositor_bridge_.get(); |
| 106 } | 111 } |
| 107 | 112 |
| 108 virtual void DispatchDrawAndSubmitCallbacks(); | 113 virtual void DispatchDrawAndSubmitCallbacks(); |
| 109 void SetTaskRunnerProviderForTesting( | 114 void SetTaskRunnerProviderForTesting( |
| 110 std::unique_ptr<TaskRunnerProvider> task_runner_provider); | 115 std::unique_ptr<TaskRunnerProvider> task_runner_provider); |
| 111 | 116 |
| 112 // RemoteCompositorBridgeClient implementation. | |
| 113 void BeginMainFrame() override; | |
| 114 bool ApplyScrollAndScaleUpdateFromClient( | |
| 115 const ScrollOffsetMap& client_scroll_map, | |
| 116 float client_page_scale) override; | |
| 117 | |
| 118 private: | 117 private: |
| 119 enum class FramePipelineStage { NONE, ANIMATE, UPDATE_LAYERS, COMMIT }; | 118 enum class FramePipelineStage { NONE, ANIMATE, UPDATE_LAYERS, COMMIT }; |
| 120 | 119 |
| 121 void MainFrameRequested(FramePipelineStage requested_pipeline_stage); | 120 void MainFrameRequested(FramePipelineStage requested_pipeline_stage); |
| 122 void ScheduleMainFrameIfNecessary(); | 121 void ScheduleMainFrameIfNecessary(); |
| 123 void MainFrameComplete(); | 122 void MainFrameComplete(); |
| 124 void SerializeCurrentState(proto::LayerTreeHost* layer_tree_host_proto); | 123 void SerializeCurrentState(proto::LayerTreeHost* layer_tree_host_proto); |
| 125 | 124 |
| 126 const int id_; | 125 const int id_; |
| 127 int source_frame_number_ = 0; | 126 int source_frame_number_ = 0; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 SurfaceSequenceGenerator surface_sequence_generator_; | 171 SurfaceSequenceGenerator surface_sequence_generator_; |
| 173 | 172 |
| 174 base::WeakPtr<InputHandler> input_handler_weak_ptr_; | 173 base::WeakPtr<InputHandler> input_handler_weak_ptr_; |
| 175 | 174 |
| 176 base::WeakPtrFactory<LayerTreeHostRemote> weak_factory_; | 175 base::WeakPtrFactory<LayerTreeHostRemote> weak_factory_; |
| 177 }; | 176 }; |
| 178 | 177 |
| 179 } // namespace cc | 178 } // namespace cc |
| 180 | 179 |
| 181 #endif // CC_BLIMP_LAYER_TREE_HOST_REMOTE_H_ | 180 #endif // CC_BLIMP_LAYER_TREE_HOST_REMOTE_H_ |
| OLD | NEW |