OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_LAYER_TREE_HOST_IN_PROCESS_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IN_PROCESS_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_IN_PROCESS_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IN_PROCESS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 public: | 84 public: |
85 // TODO(sad): InitParams should be a movable type so that it can be | 85 // TODO(sad): InitParams should be a movable type so that it can be |
86 // std::move()d to the Create* functions. | 86 // std::move()d to the Create* functions. |
87 struct CC_EXPORT InitParams { | 87 struct CC_EXPORT InitParams { |
88 LayerTreeHostClient* client = nullptr; | 88 LayerTreeHostClient* client = nullptr; |
89 SharedBitmapManager* shared_bitmap_manager = nullptr; | 89 SharedBitmapManager* shared_bitmap_manager = nullptr; |
90 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr; | 90 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr; |
91 TaskGraphRunner* task_graph_runner = nullptr; | 91 TaskGraphRunner* task_graph_runner = nullptr; |
92 LayerTreeSettings const* settings = nullptr; | 92 LayerTreeSettings const* settings = nullptr; |
93 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner; | 93 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner; |
94 std::unique_ptr<BeginFrameSource> external_begin_frame_source; | |
95 ImageSerializationProcessor* image_serialization_processor = nullptr; | 94 ImageSerializationProcessor* image_serialization_processor = nullptr; |
96 std::unique_ptr<AnimationHost> animation_host; | 95 std::unique_ptr<AnimationHost> animation_host; |
97 | 96 |
98 InitParams(); | 97 InitParams(); |
99 ~InitParams(); | 98 ~InitParams(); |
100 }; | 99 }; |
101 | 100 |
102 // The SharedBitmapManager will be used on the compositor thread. | 101 // The SharedBitmapManager will be used on the compositor thread. |
103 static std::unique_ptr<LayerTreeHostInProcess> CreateThreaded( | 102 static std::unique_ptr<LayerTreeHostInProcess> CreateThreaded( |
104 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 103 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 247 |
249 protected: | 248 protected: |
250 // Allow tests to inject the LayerTree. | 249 // Allow tests to inject the LayerTree. |
251 LayerTreeHostInProcess(InitParams* params, | 250 LayerTreeHostInProcess(InitParams* params, |
252 CompositorMode mode, | 251 CompositorMode mode, |
253 std::unique_ptr<LayerTree> layer_tree); | 252 std::unique_ptr<LayerTree> layer_tree); |
254 LayerTreeHostInProcess(InitParams* params, CompositorMode mode); | 253 LayerTreeHostInProcess(InitParams* params, CompositorMode mode); |
255 | 254 |
256 void InitializeThreaded( | 255 void InitializeThreaded( |
257 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 256 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
258 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 257 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
259 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | |
260 void InitializeSingleThreaded( | 258 void InitializeSingleThreaded( |
261 LayerTreeHostSingleThreadClient* single_thread_client, | 259 LayerTreeHostSingleThreadClient* single_thread_client, |
262 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 260 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
263 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | |
264 void InitializeRemoteServer( | 261 void InitializeRemoteServer( |
265 RemoteProtoChannel* remote_proto_channel, | 262 RemoteProtoChannel* remote_proto_channel, |
266 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 263 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
267 void InitializeRemoteClient( | 264 void InitializeRemoteClient( |
268 RemoteProtoChannel* remote_proto_channel, | 265 RemoteProtoChannel* remote_proto_channel, |
269 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 266 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
270 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 267 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
271 void InitializeForTesting( | 268 void InitializeForTesting( |
272 std::unique_ptr<TaskRunnerProvider> task_runner_provider, | 269 std::unique_ptr<TaskRunnerProvider> task_runner_provider, |
273 std::unique_ptr<Proxy> proxy_for_testing, | 270 std::unique_ptr<Proxy> proxy_for_testing); |
274 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | |
275 void InitializePictureCacheForTesting(); | 271 void InitializePictureCacheForTesting(); |
276 void SetTaskRunnerProviderForTesting( | 272 void SetTaskRunnerProviderForTesting( |
277 std::unique_ptr<TaskRunnerProvider> task_runner_provider); | 273 std::unique_ptr<TaskRunnerProvider> task_runner_provider); |
278 void SetUIResourceManagerForTesting( | 274 void SetUIResourceManagerForTesting( |
279 std::unique_ptr<UIResourceManager> ui_resource_manager); | 275 std::unique_ptr<UIResourceManager> ui_resource_manager); |
280 | 276 |
281 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and | 277 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and |
282 // task_graph_runner() return valid values only until the LayerTreeHostImpl is | 278 // task_graph_runner() return valid values only until the LayerTreeHostImpl is |
283 // created in CreateLayerTreeHostImpl(). | 279 // created in CreateLayerTreeHostImpl(). |
284 SharedBitmapManager* shared_bitmap_manager() const { | 280 SharedBitmapManager* shared_bitmap_manager() const { |
(...skipping 16 matching lines...) Expand all Loading... |
301 | 297 |
302 private: | 298 private: |
303 friend class LayerTreeHostSerializationTest; | 299 friend class LayerTreeHostSerializationTest; |
304 | 300 |
305 // This is the number of consecutive frames in which we want the content to be | 301 // This is the number of consecutive frames in which we want the content to be |
306 // suitable for GPU rasterization before re-enabling it. | 302 // suitable for GPU rasterization before re-enabling it. |
307 enum { kNumFramesToConsiderBeforeGpuRasterization = 60 }; | 303 enum { kNumFramesToConsiderBeforeGpuRasterization = 60 }; |
308 | 304 |
309 void ApplyViewportDeltas(ScrollAndScaleSet* info); | 305 void ApplyViewportDeltas(ScrollAndScaleSet* info); |
310 void ApplyPageScaleDeltaFromImplSide(float page_scale_delta); | 306 void ApplyPageScaleDeltaFromImplSide(float page_scale_delta); |
311 void InitializeProxy( | 307 void InitializeProxy(std::unique_ptr<Proxy> proxy); |
312 std::unique_ptr<Proxy> proxy, | |
313 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | |
314 | 308 |
315 bool DoUpdateLayers(Layer* root_layer); | 309 bool DoUpdateLayers(Layer* root_layer); |
316 void UpdateHudLayer(); | 310 void UpdateHudLayer(); |
317 | 311 |
318 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); | 312 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); |
319 | 313 |
320 void CalculateLCDTextMetricsCallback(Layer* layer); | 314 void CalculateLCDTextMetricsCallback(Layer* layer); |
321 | 315 |
322 void SetPropertyTreesNeedRebuild(); | 316 void SetPropertyTreesNeedRebuild(); |
323 | 317 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 363 |
370 SurfaceSequenceGenerator surface_sequence_generator_; | 364 SurfaceSequenceGenerator surface_sequence_generator_; |
371 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; | 365 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; |
372 | 366 |
373 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostInProcess); | 367 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostInProcess); |
374 }; | 368 }; |
375 | 369 |
376 } // namespace cc | 370 } // namespace cc |
377 | 371 |
378 #endif // CC_TREES_LAYER_TREE_HOST_IN_PROCESS_H_ | 372 #endif // CC_TREES_LAYER_TREE_HOST_IN_PROCESS_H_ |
OLD | NEW |