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

Side by Side Diff: cc/blimp/layer_tree_host_remote.h

Issue 2404953002: cc/blimp: Set up hooks for scroll/scale sync. (Closed)
Patch Set: braces Created 4 years, 2 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 | « no previous file | cc/blimp/layer_tree_host_remote.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 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 RemoteCompositorBridge* remote_compositor_bridge() const { 105 RemoteCompositorBridge* remote_compositor_bridge() const {
106 return remote_compositor_bridge_.get(); 106 return remote_compositor_bridge_.get();
107 } 107 }
108 108
109 virtual void DispatchDrawAndSwapCallbacks(); 109 virtual void DispatchDrawAndSwapCallbacks();
110 void SetTaskRunnerProviderForTesting( 110 void SetTaskRunnerProviderForTesting(
111 std::unique_ptr<TaskRunnerProvider> task_runner_provider); 111 std::unique_ptr<TaskRunnerProvider> task_runner_provider);
112 112
113 // RemoteCompositorBridgeClient implementation. 113 // RemoteCompositorBridgeClient implementation.
114 void BeginMainFrame() override; 114 void BeginMainFrame() override;
115 bool ApplyScrollAndScaleUpdateFromClient(
116 const ScrollOffsetMap& client_scroll_map,
117 float client_page_scale) override;
115 118
116 private: 119 private:
117 enum class FramePipelineStage { NONE, ANIMATE, UPDATE_LAYERS, COMMIT }; 120 enum class FramePipelineStage { NONE, ANIMATE, UPDATE_LAYERS, COMMIT };
118 121
119 void MainFrameRequested(FramePipelineStage requested_pipeline_stage); 122 void MainFrameRequested(FramePipelineStage requested_pipeline_stage);
120 void ScheduleMainFrameIfNecessary(); 123 void ScheduleMainFrameIfNecessary();
121 void MainFrameComplete(); 124 void MainFrameComplete();
122 void SerializeCurrentState(proto::LayerTreeHost* layer_tree_host_proto); 125 void SerializeCurrentState(proto::LayerTreeHost* layer_tree_host_proto);
123 126
124 const int id_; 127 const int id_;
125 int source_frame_number_ = 0; 128 int source_frame_number_ = 0;
126 bool visible_ = false; 129 bool visible_ = false;
127 bool defer_commits_ = false; 130 bool defer_commits_ = false;
128 131
132 // In threaded/single-threaded mode, the LayerTree and Layers expect scroll/
133 // scale updates to come from the impl thread only during the main frame.
134 // Since we synchronize state outside of that, this is set so we can
135 // temporarily report that a commit is in progress.
136 bool synchronizing_client_updates_ = false;
137
129 // Set to true if a main frame request is pending on the 138 // Set to true if a main frame request is pending on the
130 // RemoteCompositorBridge. 139 // RemoteCompositorBridge.
131 bool main_frame_requested_from_bridge_ = false; 140 bool main_frame_requested_from_bridge_ = false;
132 141
133 // Set to the pipeline stage we are currently at if we are inside a main frame 142 // Set to the pipeline stage we are currently at if we are inside a main frame
134 // update. 143 // update.
135 FramePipelineStage current_pipeline_stage_ = FramePipelineStage::NONE; 144 FramePipelineStage current_pipeline_stage_ = FramePipelineStage::NONE;
136 145
137 // Set to the pipeline stage we need to go to for the current main frame 146 // Set to the pipeline stage we need to go to for the current main frame
138 // update, if we are inside a main frame update. 147 // update, if we are inside a main frame update.
(...skipping 25 matching lines...) Expand all
164 SurfaceSequenceGenerator surface_sequence_generator_; 173 SurfaceSequenceGenerator surface_sequence_generator_;
165 174
166 base::WeakPtr<InputHandler> input_handler_weak_ptr_; 175 base::WeakPtr<InputHandler> input_handler_weak_ptr_;
167 176
168 base::WeakPtrFactory<LayerTreeHostRemote> weak_factory_; 177 base::WeakPtrFactory<LayerTreeHostRemote> weak_factory_;
169 }; 178 };
170 179
171 } // namespace cc 180 } // namespace cc
172 181
173 #endif // CC_BLIMP_LAYER_TREE_HOST_REMOTE_H_ 182 #endif // CC_BLIMP_LAYER_TREE_HOST_REMOTE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/blimp/layer_tree_host_remote.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698