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_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_H_ |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class AnimationRegistrar; | 51 class AnimationRegistrar; |
52 class AnimationHost; | 52 class AnimationHost; |
53 class BeginFrameSource; | 53 class BeginFrameSource; |
54 class HeadsUpDisplayLayer; | 54 class HeadsUpDisplayLayer; |
55 class Layer; | 55 class Layer; |
56 class LayerTreeHostImpl; | 56 class LayerTreeHostImpl; |
57 class LayerTreeHostImplClient; | 57 class LayerTreeHostImplClient; |
58 class LayerTreeHostSingleThreadClient; | 58 class LayerTreeHostSingleThreadClient; |
59 class PropertyTrees; | 59 class PropertyTrees; |
60 class Region; | 60 class Region; |
| 61 class RemoteProtoChannel; |
61 class RenderingStatsInstrumentation; | 62 class RenderingStatsInstrumentation; |
62 class ResourceProvider; | 63 class ResourceProvider; |
63 class ResourceUpdateQueue; | 64 class ResourceUpdateQueue; |
64 class SharedBitmapManager; | 65 class SharedBitmapManager; |
65 class TaskGraphRunner; | 66 class TaskGraphRunner; |
66 class TopControlsManager; | 67 class TopControlsManager; |
67 class UIResourceRequest; | 68 class UIResourceRequest; |
68 struct PendingPageScaleAnimation; | 69 struct PendingPageScaleAnimation; |
69 struct RenderingStats; | 70 struct RenderingStats; |
70 struct ScrollAndScaleSet; | 71 struct ScrollAndScaleSet; |
(...skipping 16 matching lines...) Expand all Loading... |
87 }; | 88 }; |
88 | 89 |
89 // The SharedBitmapManager will be used on the compositor thread. | 90 // The SharedBitmapManager will be used on the compositor thread. |
90 static scoped_ptr<LayerTreeHost> CreateThreaded( | 91 static scoped_ptr<LayerTreeHost> CreateThreaded( |
91 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 92 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
92 InitParams* params); | 93 InitParams* params); |
93 | 94 |
94 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( | 95 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( |
95 LayerTreeHostSingleThreadClient* single_thread_client, | 96 LayerTreeHostSingleThreadClient* single_thread_client, |
96 InitParams* params); | 97 InitParams* params); |
| 98 |
| 99 static scoped_ptr<LayerTreeHost> CreateRemote( |
| 100 RemoteProtoChannel* remote_proto_channel, |
| 101 InitParams* params); |
| 102 |
| 103 static scoped_ptr<LayerTreeHost> CreateDeserializable( |
| 104 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 105 InitParams* params); |
| 106 |
97 virtual ~LayerTreeHost(); | 107 virtual ~LayerTreeHost(); |
98 | 108 |
| 109 // Should be called only for the remote mode. |
| 110 void ToProtobuf(); |
| 111 |
| 112 // Should be called only for the deserializable mode. |
| 113 void FromProtobuf(); |
| 114 |
99 // LayerTreeHost interface to Proxy. | 115 // LayerTreeHost interface to Proxy. |
100 void WillBeginMainFrame(); | 116 void WillBeginMainFrame(); |
101 void DidBeginMainFrame(); | 117 void DidBeginMainFrame(); |
102 void BeginMainFrame(const BeginFrameArgs& args); | 118 void BeginMainFrame(const BeginFrameArgs& args); |
103 void BeginMainFrameNotExpectedSoon(); | 119 void BeginMainFrameNotExpectedSoon(); |
104 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); | 120 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); |
105 void DidStopFlinging(); | 121 void DidStopFlinging(); |
106 void RequestMainFrameUpdate(); | 122 void RequestMainFrameUpdate(); |
107 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); | 123 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); |
108 void WillCommit(); | 124 void WillCommit(); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 protected: | 382 protected: |
367 LayerTreeHost(InitParams* params, CompositorMode mode); | 383 LayerTreeHost(InitParams* params, CompositorMode mode); |
368 void InitializeThreaded( | 384 void InitializeThreaded( |
369 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 385 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
370 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 386 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
371 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 387 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
372 void InitializeSingleThreaded( | 388 void InitializeSingleThreaded( |
373 LayerTreeHostSingleThreadClient* single_thread_client, | 389 LayerTreeHostSingleThreadClient* single_thread_client, |
374 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 390 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
375 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 391 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
| 392 void InitializeRemote( |
| 393 RemoteProtoChannel* remote_proto_channel, |
| 394 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
| 395 void InitializeDeserializable( |
| 396 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 397 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
376 void InitializeForTesting(scoped_ptr<TaskRunnerProvider> task_runner_provider, | 398 void InitializeForTesting(scoped_ptr<TaskRunnerProvider> task_runner_provider, |
377 scoped_ptr<Proxy> proxy_for_testing); | 399 scoped_ptr<Proxy> proxy_for_testing); |
378 void SetOutputSurfaceLostForTesting(bool is_lost) { | 400 void SetOutputSurfaceLostForTesting(bool is_lost) { |
379 output_surface_lost_ = is_lost; | 401 output_surface_lost_ = is_lost; |
380 } | 402 } |
381 void SetTaskRunnerProviderForTesting( | 403 void SetTaskRunnerProviderForTesting( |
382 scoped_ptr<TaskRunnerProvider> task_runner_provider); | 404 scoped_ptr<TaskRunnerProvider> task_runner_provider); |
383 | 405 |
384 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and | 406 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and |
385 // task_graph_runner() return valid values only until the LayerTreeHostImpl is | 407 // task_graph_runner() return valid values only until the LayerTreeHostImpl is |
(...skipping 15 matching lines...) Expand all Loading... |
401 private: | 423 private: |
402 void InitializeProxy(scoped_ptr<Proxy> proxy); | 424 void InitializeProxy(scoped_ptr<Proxy> proxy); |
403 | 425 |
404 bool DoUpdateLayers(Layer* root_layer); | 426 bool DoUpdateLayers(Layer* root_layer); |
405 void UpdateHudLayer(); | 427 void UpdateHudLayer(); |
406 | 428 |
407 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); | 429 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); |
408 | 430 |
409 bool IsSingleThreaded() const; | 431 bool IsSingleThreaded() const; |
410 bool IsThreaded() const; | 432 bool IsThreaded() const; |
| 433 bool IsRemote() const; |
| 434 bool IsDeserializable() const; |
411 | 435 |
412 struct UIResourceClientData { | 436 struct UIResourceClientData { |
413 UIResourceClient* client; | 437 UIResourceClient* client; |
414 gfx::Size size; | 438 gfx::Size size; |
415 }; | 439 }; |
416 | 440 |
417 typedef base::hash_map<UIResourceId, UIResourceClientData> | 441 typedef base::hash_map<UIResourceId, UIResourceClientData> |
418 UIResourceClientMap; | 442 UIResourceClientMap; |
419 UIResourceClientMap ui_resource_client_map_; | 443 UIResourceClientMap ui_resource_client_map_; |
420 int next_ui_resource_id_; | 444 int next_ui_resource_id_; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 537 |
514 uint32_t surface_id_namespace_; | 538 uint32_t surface_id_namespace_; |
515 uint32_t next_surface_sequence_; | 539 uint32_t next_surface_sequence_; |
516 | 540 |
517 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 541 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
518 }; | 542 }; |
519 | 543 |
520 } // namespace cc | 544 } // namespace cc |
521 | 545 |
522 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 546 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |