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

Side by Side Diff: cc/trees/layer_tree_host.h

Issue 1513643010: cc:: Add remote mode to the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresed comments. Created 4 years, 11 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
OLDNEW
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
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
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
119 // Should be called only for the remote mode.
120 void ToProtobuf();
121
122 // Should be called only for the deserializable mode.
vmpstr 2016/01/11 21:50:15 This isn't a mode anymore, can you update the comm
Khushal 2016/01/13 02:07:12 I'll just remove these. Tommy is already working o
123 void FromProtobuf();
124
102 // LayerTreeHost interface to Proxy. 125 // LayerTreeHost interface to Proxy.
103 void WillBeginMainFrame(); 126 void WillBeginMainFrame();
104 void DidBeginMainFrame(); 127 void DidBeginMainFrame();
105 void BeginMainFrame(const BeginFrameArgs& args); 128 void BeginMainFrame(const BeginFrameArgs& args);
106 void BeginMainFrameNotExpectedSoon(); 129 void BeginMainFrameNotExpectedSoon();
107 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); 130 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time);
108 void DidStopFlinging(); 131 void DidStopFlinging();
109 void RequestMainFrameUpdate(); 132 void RequestMainFrameUpdate();
110 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); 133 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl);
111 void WillCommit(); 134 void WillCommit();
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 protected: 392 protected:
370 LayerTreeHost(InitParams* params, CompositorMode mode); 393 LayerTreeHost(InitParams* params, CompositorMode mode);
371 void InitializeThreaded( 394 void InitializeThreaded(
372 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 395 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
373 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 396 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
374 scoped_ptr<BeginFrameSource> external_begin_frame_source); 397 scoped_ptr<BeginFrameSource> external_begin_frame_source);
375 void InitializeSingleThreaded( 398 void InitializeSingleThreaded(
376 LayerTreeHostSingleThreadClient* single_thread_client, 399 LayerTreeHostSingleThreadClient* single_thread_client,
377 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 400 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
378 scoped_ptr<BeginFrameSource> external_begin_frame_source); 401 scoped_ptr<BeginFrameSource> external_begin_frame_source);
402 void InitializeRemoteServer(
403 RemoteProtoChannel* remote_proto_channel,
404 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner);
405 void InitializeRemoteClient(
406 RemoteProtoChannel* remote_proto_channel,
407 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
408 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
379 void InitializeForTesting( 409 void InitializeForTesting(
380 scoped_ptr<TaskRunnerProvider> task_runner_provider, 410 scoped_ptr<TaskRunnerProvider> task_runner_provider,
381 scoped_ptr<Proxy> proxy_for_testing, 411 scoped_ptr<Proxy> proxy_for_testing,
382 scoped_ptr<BeginFrameSource> external_begin_frame_source); 412 scoped_ptr<BeginFrameSource> external_begin_frame_source);
383 void SetOutputSurfaceLostForTesting(bool is_lost) { 413 void SetOutputSurfaceLostForTesting(bool is_lost) {
384 output_surface_lost_ = is_lost; 414 output_surface_lost_ = is_lost;
385 } 415 }
386 void SetTaskRunnerProviderForTesting( 416 void SetTaskRunnerProviderForTesting(
387 scoped_ptr<TaskRunnerProvider> task_runner_provider); 417 scoped_ptr<TaskRunnerProvider> task_runner_provider);
388 418
(...skipping 19 matching lines...) Expand all
408 scoped_ptr<Proxy> proxy, 438 scoped_ptr<Proxy> proxy,
409 scoped_ptr<BeginFrameSource> external_begin_frame_source); 439 scoped_ptr<BeginFrameSource> external_begin_frame_source);
410 440
411 bool DoUpdateLayers(Layer* root_layer); 441 bool DoUpdateLayers(Layer* root_layer);
412 void UpdateHudLayer(); 442 void UpdateHudLayer();
413 443
414 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); 444 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time);
415 445
416 bool IsSingleThreaded() const; 446 bool IsSingleThreaded() const;
417 bool IsThreaded() const; 447 bool IsThreaded() const;
448 bool IsRemoteServer() const;
449 bool IsRemoteClient() const;
418 450
419 struct UIResourceClientData { 451 struct UIResourceClientData {
420 UIResourceClient* client; 452 UIResourceClient* client;
421 gfx::Size size; 453 gfx::Size size;
422 }; 454 };
423 455
424 typedef base::hash_map<UIResourceId, UIResourceClientData> 456 typedef base::hash_map<UIResourceId, UIResourceClientData>
425 UIResourceClientMap; 457 UIResourceClientMap;
426 UIResourceClientMap ui_resource_client_map_; 458 UIResourceClientMap ui_resource_client_map_;
427 int next_ui_resource_id_; 459 int next_ui_resource_id_;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 552
521 uint32_t surface_id_namespace_; 553 uint32_t surface_id_namespace_;
522 uint32_t next_surface_sequence_; 554 uint32_t next_surface_sequence_;
523 555
524 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 556 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
525 }; 557 };
526 558
527 } // namespace cc 559 } // namespace cc
528 560
529 #endif // CC_TREES_LAYER_TREE_HOST_H_ 561 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698