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

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: Created 5 years 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 <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
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
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
99 // LayerTreeHost interface to Proxy. 109 // LayerTreeHost interface to Proxy.
100 void WillBeginMainFrame(); 110 void WillBeginMainFrame();
101 void DidBeginMainFrame(); 111 void DidBeginMainFrame();
102 void BeginMainFrame(const BeginFrameArgs& args); 112 void BeginMainFrame(const BeginFrameArgs& args);
103 void BeginMainFrameNotExpectedSoon(); 113 void BeginMainFrameNotExpectedSoon();
104 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); 114 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time);
105 void DidStopFlinging(); 115 void DidStopFlinging();
106 void RequestMainFrameUpdate(); 116 void RequestMainFrameUpdate();
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 protected: 372 protected:
363 LayerTreeHost(InitParams* params, CompositorMode mode); 373 LayerTreeHost(InitParams* params, CompositorMode mode);
364 void InitializeThreaded( 374 void InitializeThreaded(
365 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 375 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
366 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 376 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
367 scoped_ptr<BeginFrameSource> external_begin_frame_source); 377 scoped_ptr<BeginFrameSource> external_begin_frame_source);
368 void InitializeSingleThreaded( 378 void InitializeSingleThreaded(
369 LayerTreeHostSingleThreadClient* single_thread_client, 379 LayerTreeHostSingleThreadClient* single_thread_client,
370 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 380 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
371 scoped_ptr<BeginFrameSource> external_begin_frame_source); 381 scoped_ptr<BeginFrameSource> external_begin_frame_source);
382 void InitializeRemote(
383 RemoteProtoChannel* remote_proto_channel,
384 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner);
385 void InitializeDeserializable(
386 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
387 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
372 void InitializeForTesting(scoped_ptr<TaskRunnerProvider> task_runner_provider, 388 void InitializeForTesting(scoped_ptr<TaskRunnerProvider> task_runner_provider,
373 scoped_ptr<Proxy> proxy_for_testing); 389 scoped_ptr<Proxy> proxy_for_testing);
374 void SetOutputSurfaceLostForTesting(bool is_lost) { 390 void SetOutputSurfaceLostForTesting(bool is_lost) {
375 output_surface_lost_ = is_lost; 391 output_surface_lost_ = is_lost;
376 } 392 }
377 393
378 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and 394 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and
379 // task_graph_runner() return valid values only until the LayerTreeHostImpl is 395 // task_graph_runner() return valid values only until the LayerTreeHostImpl is
380 // created in CreateLayerTreeHostImpl(). 396 // created in CreateLayerTreeHostImpl().
381 SharedBitmapManager* shared_bitmap_manager() const { 397 SharedBitmapManager* shared_bitmap_manager() const {
(...skipping 11 matching lines...) Expand all
393 private: 409 private:
394 void InitializeProxy(scoped_ptr<Proxy> proxy); 410 void InitializeProxy(scoped_ptr<Proxy> proxy);
395 411
396 bool DoUpdateLayers(Layer* root_layer); 412 bool DoUpdateLayers(Layer* root_layer);
397 void UpdateHudLayer(); 413 void UpdateHudLayer();
398 414
399 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); 415 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time);
400 416
401 bool IsSingleThreaded() const; 417 bool IsSingleThreaded() const;
402 bool IsThreaded() const; 418 bool IsThreaded() const;
419 bool IsRemote() const;
420 bool IsDeserializable() const;
403 421
404 struct UIResourceClientData { 422 struct UIResourceClientData {
405 UIResourceClient* client; 423 UIResourceClient* client;
406 gfx::Size size; 424 gfx::Size size;
407 }; 425 };
408 426
409 typedef base::hash_map<UIResourceId, UIResourceClientData> 427 typedef base::hash_map<UIResourceId, UIResourceClientData>
410 UIResourceClientMap; 428 UIResourceClientMap;
411 UIResourceClientMap ui_resource_client_map_; 429 UIResourceClientMap ui_resource_client_map_;
412 int next_ui_resource_id_; 430 int next_ui_resource_id_;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 524
507 uint32_t surface_id_namespace_; 525 uint32_t surface_id_namespace_;
508 uint32_t next_surface_sequence_; 526 uint32_t next_surface_sequence_;
509 527
510 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 528 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
511 }; 529 };
512 530
513 } // namespace cc 531 } // namespace cc
514 532
515 #endif // CC_TREES_LAYER_TREE_HOST_H_ 533 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698