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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 class AnimationRegistrar; | 54 class AnimationRegistrar; |
55 class AnimationHost; | 55 class AnimationHost; |
56 class BeginFrameSource; | 56 class BeginFrameSource; |
57 class HeadsUpDisplayLayer; | 57 class HeadsUpDisplayLayer; |
58 class Layer; | 58 class Layer; |
59 class LayerTreeHostImpl; | 59 class LayerTreeHostImpl; |
60 class LayerTreeHostImplClient; | 60 class LayerTreeHostImplClient; |
61 class LayerTreeHostSingleThreadClient; | 61 class LayerTreeHostSingleThreadClient; |
62 class PropertyTrees; | 62 class PropertyTrees; |
63 class Region; | 63 class Region; |
| 64 class RemoteProtoChannel; |
64 class RenderingStatsInstrumentation; | 65 class RenderingStatsInstrumentation; |
65 class ResourceProvider; | 66 class ResourceProvider; |
66 class ResourceUpdateQueue; | 67 class ResourceUpdateQueue; |
67 class SharedBitmapManager; | 68 class SharedBitmapManager; |
68 class TaskGraphRunner; | 69 class TaskGraphRunner; |
69 class TopControlsManager; | 70 class TopControlsManager; |
70 class UIResourceRequest; | 71 class UIResourceRequest; |
71 struct PendingPageScaleAnimation; | 72 struct PendingPageScaleAnimation; |
72 struct RenderingStats; | 73 struct RenderingStats; |
73 struct ScrollAndScaleSet; | 74 struct ScrollAndScaleSet; |
(...skipping 16 matching lines...) Expand all Loading... |
90 }; | 91 }; |
91 | 92 |
92 // The SharedBitmapManager will be used on the compositor thread. | 93 // The SharedBitmapManager will be used on the compositor thread. |
93 static scoped_ptr<LayerTreeHost> CreateThreaded( | 94 static scoped_ptr<LayerTreeHost> CreateThreaded( |
94 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 95 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
95 InitParams* params); | 96 InitParams* params); |
96 | 97 |
97 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( | 98 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( |
98 LayerTreeHostSingleThreadClient* single_thread_client, | 99 LayerTreeHostSingleThreadClient* single_thread_client, |
99 InitParams* params); | 100 InitParams* params); |
| 101 |
| 102 static scoped_ptr<LayerTreeHost> CreateRemoteServer( |
| 103 RemoteProtoChannel* remote_proto_channel, |
| 104 InitParams* params); |
| 105 |
| 106 // The lifetime of this LayerTreeHost is tied to the lifetime of the remote |
| 107 // server LayerTreeHost. It should be created on receiving |
| 108 // CompositorMessageToImpl::InitializeImpl message and destroyed on receiving |
| 109 // a CompositorMessageToImpl::CloseImpl message from the server. This ensures |
| 110 // that the client will not send any compositor messages once the |
| 111 // LayerTreeHost on the server is destroyed. |
| 112 static scoped_ptr<LayerTreeHost> CreateRemoteClient( |
| 113 RemoteProtoChannel* remote_proto_channel, |
| 114 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 115 InitParams* params); |
| 116 |
100 virtual ~LayerTreeHost(); | 117 virtual ~LayerTreeHost(); |
101 | 118 |
102 // LayerTreeHost interface to Proxy. | 119 // LayerTreeHost interface to Proxy. |
103 void WillBeginMainFrame(); | 120 void WillBeginMainFrame(); |
104 void DidBeginMainFrame(); | 121 void DidBeginMainFrame(); |
105 void BeginMainFrame(const BeginFrameArgs& args); | 122 void BeginMainFrame(const BeginFrameArgs& args); |
106 void BeginMainFrameNotExpectedSoon(); | 123 void BeginMainFrameNotExpectedSoon(); |
107 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); | 124 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); |
108 void DidStopFlinging(); | 125 void DidStopFlinging(); |
109 void RequestMainFrameUpdate(); | 126 void RequestMainFrameUpdate(); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 protected: | 386 protected: |
370 LayerTreeHost(InitParams* params, CompositorMode mode); | 387 LayerTreeHost(InitParams* params, CompositorMode mode); |
371 void InitializeThreaded( | 388 void InitializeThreaded( |
372 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 389 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
373 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 390 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
374 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 391 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
375 void InitializeSingleThreaded( | 392 void InitializeSingleThreaded( |
376 LayerTreeHostSingleThreadClient* single_thread_client, | 393 LayerTreeHostSingleThreadClient* single_thread_client, |
377 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 394 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
378 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 395 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
| 396 void InitializeRemoteServer( |
| 397 RemoteProtoChannel* remote_proto_channel, |
| 398 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
| 399 void InitializeRemoteClient( |
| 400 RemoteProtoChannel* remote_proto_channel, |
| 401 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 402 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
379 void InitializeForTesting( | 403 void InitializeForTesting( |
380 scoped_ptr<TaskRunnerProvider> task_runner_provider, | 404 scoped_ptr<TaskRunnerProvider> task_runner_provider, |
381 scoped_ptr<Proxy> proxy_for_testing, | 405 scoped_ptr<Proxy> proxy_for_testing, |
382 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 406 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
383 void SetOutputSurfaceLostForTesting(bool is_lost) { | 407 void SetOutputSurfaceLostForTesting(bool is_lost) { |
384 output_surface_lost_ = is_lost; | 408 output_surface_lost_ = is_lost; |
385 } | 409 } |
386 void SetTaskRunnerProviderForTesting( | 410 void SetTaskRunnerProviderForTesting( |
387 scoped_ptr<TaskRunnerProvider> task_runner_provider); | 411 scoped_ptr<TaskRunnerProvider> task_runner_provider); |
388 | 412 |
(...skipping 19 matching lines...) Expand all Loading... |
408 scoped_ptr<Proxy> proxy, | 432 scoped_ptr<Proxy> proxy, |
409 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 433 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
410 | 434 |
411 bool DoUpdateLayers(Layer* root_layer); | 435 bool DoUpdateLayers(Layer* root_layer); |
412 void UpdateHudLayer(); | 436 void UpdateHudLayer(); |
413 | 437 |
414 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); | 438 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); |
415 | 439 |
416 bool IsSingleThreaded() const; | 440 bool IsSingleThreaded() const; |
417 bool IsThreaded() const; | 441 bool IsThreaded() const; |
| 442 bool IsRemoteServer() const; |
| 443 bool IsRemoteClient() const; |
418 | 444 |
419 struct UIResourceClientData { | 445 struct UIResourceClientData { |
420 UIResourceClient* client; | 446 UIResourceClient* client; |
421 gfx::Size size; | 447 gfx::Size size; |
422 }; | 448 }; |
423 | 449 |
424 typedef base::hash_map<UIResourceId, UIResourceClientData> | 450 typedef base::hash_map<UIResourceId, UIResourceClientData> |
425 UIResourceClientMap; | 451 UIResourceClientMap; |
426 UIResourceClientMap ui_resource_client_map_; | 452 UIResourceClientMap ui_resource_client_map_; |
427 int next_ui_resource_id_; | 453 int next_ui_resource_id_; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 | 546 |
521 uint32_t surface_id_namespace_; | 547 uint32_t surface_id_namespace_; |
522 uint32_t next_surface_sequence_; | 548 uint32_t next_surface_sequence_; |
523 | 549 |
524 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 550 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
525 }; | 551 }; |
526 | 552 |
527 } // namespace cc | 553 } // namespace cc |
528 | 554 |
529 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 555 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |