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

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: Rebase. 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> CreateRemote(
103 RemoteProtoChannel* remote_proto_channel,
104 InitParams* params);
105
106 static scoped_ptr<LayerTreeHost> CreateDeserializable(
107 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
108 InitParams* params);
109
100 virtual ~LayerTreeHost(); 110 virtual ~LayerTreeHost();
101 111
112 // Should be called only for the remote mode.
113 void ToProtobuf();
114
115 // Should be called only for the deserializable mode.
116 void FromProtobuf();
117
102 // LayerTreeHost interface to Proxy. 118 // LayerTreeHost interface to Proxy.
103 void WillBeginMainFrame(); 119 void WillBeginMainFrame();
104 void DidBeginMainFrame(); 120 void DidBeginMainFrame();
105 void BeginMainFrame(const BeginFrameArgs& args); 121 void BeginMainFrame(const BeginFrameArgs& args);
106 void BeginMainFrameNotExpectedSoon(); 122 void BeginMainFrameNotExpectedSoon();
107 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); 123 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time);
108 void DidStopFlinging(); 124 void DidStopFlinging();
109 void RequestMainFrameUpdate(); 125 void RequestMainFrameUpdate();
110 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); 126 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl);
111 void WillCommit(); 127 void WillCommit();
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 protected: 385 protected:
370 LayerTreeHost(InitParams* params, CompositorMode mode); 386 LayerTreeHost(InitParams* params, CompositorMode mode);
371 void InitializeThreaded( 387 void InitializeThreaded(
372 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 388 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
373 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 389 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
374 scoped_ptr<BeginFrameSource> external_begin_frame_source); 390 scoped_ptr<BeginFrameSource> external_begin_frame_source);
375 void InitializeSingleThreaded( 391 void InitializeSingleThreaded(
376 LayerTreeHostSingleThreadClient* single_thread_client, 392 LayerTreeHostSingleThreadClient* single_thread_client,
377 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 393 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
378 scoped_ptr<BeginFrameSource> external_begin_frame_source); 394 scoped_ptr<BeginFrameSource> external_begin_frame_source);
395 void InitializeRemote(
396 RemoteProtoChannel* remote_proto_channel,
397 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner);
398 void InitializeDeserializable(
399 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
400 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
379 void InitializeForTesting( 401 void InitializeForTesting(
380 scoped_ptr<TaskRunnerProvider> task_runner_provider, 402 scoped_ptr<TaskRunnerProvider> task_runner_provider,
381 scoped_ptr<Proxy> proxy_for_testing, 403 scoped_ptr<Proxy> proxy_for_testing,
382 scoped_ptr<BeginFrameSource> external_begin_frame_source); 404 scoped_ptr<BeginFrameSource> external_begin_frame_source);
383 void SetOutputSurfaceLostForTesting(bool is_lost) { 405 void SetOutputSurfaceLostForTesting(bool is_lost) {
384 output_surface_lost_ = is_lost; 406 output_surface_lost_ = is_lost;
385 } 407 }
386 void SetTaskRunnerProviderForTesting( 408 void SetTaskRunnerProviderForTesting(
387 scoped_ptr<TaskRunnerProvider> task_runner_provider); 409 scoped_ptr<TaskRunnerProvider> task_runner_provider);
388 410
(...skipping 19 matching lines...) Expand all
408 scoped_ptr<Proxy> proxy, 430 scoped_ptr<Proxy> proxy,
409 scoped_ptr<BeginFrameSource> external_begin_frame_source); 431 scoped_ptr<BeginFrameSource> external_begin_frame_source);
410 432
411 bool DoUpdateLayers(Layer* root_layer); 433 bool DoUpdateLayers(Layer* root_layer);
412 void UpdateHudLayer(); 434 void UpdateHudLayer();
413 435
414 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); 436 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time);
415 437
416 bool IsSingleThreaded() const; 438 bool IsSingleThreaded() const;
417 bool IsThreaded() const; 439 bool IsThreaded() const;
440 bool IsRemote() const;
vmpstr 2016/01/07 19:08:12 At some point, these function should just become
Khushal 2016/01/08 21:17:19 Updated these functions to IsRemoteServer and IsRe
441 bool IsDeserializable() const;
418 442
419 struct UIResourceClientData { 443 struct UIResourceClientData {
420 UIResourceClient* client; 444 UIResourceClient* client;
421 gfx::Size size; 445 gfx::Size size;
422 }; 446 };
423 447
424 typedef base::hash_map<UIResourceId, UIResourceClientData> 448 typedef base::hash_map<UIResourceId, UIResourceClientData>
425 UIResourceClientMap; 449 UIResourceClientMap;
426 UIResourceClientMap ui_resource_client_map_; 450 UIResourceClientMap ui_resource_client_map_;
427 int next_ui_resource_id_; 451 int next_ui_resource_id_;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 544
521 uint32_t surface_id_namespace_; 545 uint32_t surface_id_namespace_;
522 uint32_t next_surface_sequence_; 546 uint32_t next_surface_sequence_;
523 547
524 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 548 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
525 }; 549 };
526 550
527 } // namespace cc 551 } // namespace cc
528 552
529 #endif // CC_TREES_LAYER_TREE_HOST_H_ 553 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698