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 |
11 #include <limits> | 11 #include <limits> |
| 12 #include <memory> |
12 #include <set> | 13 #include <set> |
13 #include <string> | 14 #include <string> |
14 #include <unordered_map> | 15 #include <unordered_map> |
15 #include <vector> | 16 #include <vector> |
16 | 17 |
17 #include "base/cancelable_callback.h" | 18 #include "base/cancelable_callback.h" |
18 #include "base/macros.h" | 19 #include "base/macros.h" |
19 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
20 #include "base/memory/scoped_ptr.h" | |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "cc/animation/target_property.h" | 23 #include "cc/animation/target_property.h" |
24 #include "cc/base/cc_export.h" | 24 #include "cc/base/cc_export.h" |
25 #include "cc/debug/frame_timing_tracker.h" | 25 #include "cc/debug/frame_timing_tracker.h" |
26 #include "cc/debug/micro_benchmark.h" | 26 #include "cc/debug/micro_benchmark.h" |
27 #include "cc/debug/micro_benchmark_controller.h" | 27 #include "cc/debug/micro_benchmark_controller.h" |
28 #include "cc/input/event_listener_properties.h" | 28 #include "cc/input/event_listener_properties.h" |
29 #include "cc/input/input_handler.h" | 29 #include "cc/input/input_handler.h" |
30 #include "cc/input/layer_selection_bound.h" | 30 #include "cc/input/layer_selection_bound.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 public: | 84 public: |
85 // TODO(sad): InitParams should be a movable type so that it can be | 85 // TODO(sad): InitParams should be a movable type so that it can be |
86 // std::move()d to the Create* functions. | 86 // std::move()d to the Create* functions. |
87 struct CC_EXPORT InitParams { | 87 struct CC_EXPORT InitParams { |
88 LayerTreeHostClient* client = nullptr; | 88 LayerTreeHostClient* client = nullptr; |
89 SharedBitmapManager* shared_bitmap_manager = nullptr; | 89 SharedBitmapManager* shared_bitmap_manager = nullptr; |
90 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr; | 90 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr; |
91 TaskGraphRunner* task_graph_runner = nullptr; | 91 TaskGraphRunner* task_graph_runner = nullptr; |
92 LayerTreeSettings const* settings = nullptr; | 92 LayerTreeSettings const* settings = nullptr; |
93 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner; | 93 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner; |
94 scoped_ptr<BeginFrameSource> external_begin_frame_source; | 94 std::unique_ptr<BeginFrameSource> external_begin_frame_source; |
95 ImageSerializationProcessor* image_serialization_processor = nullptr; | 95 ImageSerializationProcessor* image_serialization_processor = nullptr; |
96 | 96 |
97 InitParams(); | 97 InitParams(); |
98 ~InitParams(); | 98 ~InitParams(); |
99 }; | 99 }; |
100 | 100 |
101 // The SharedBitmapManager will be used on the compositor thread. | 101 // The SharedBitmapManager will be used on the compositor thread. |
102 static scoped_ptr<LayerTreeHost> CreateThreaded( | 102 static std::unique_ptr<LayerTreeHost> CreateThreaded( |
103 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 103 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
104 InitParams* params); | 104 InitParams* params); |
105 | 105 |
106 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( | 106 static std::unique_ptr<LayerTreeHost> CreateSingleThreaded( |
107 LayerTreeHostSingleThreadClient* single_thread_client, | 107 LayerTreeHostSingleThreadClient* single_thread_client, |
108 InitParams* params); | 108 InitParams* params); |
109 | 109 |
110 static scoped_ptr<LayerTreeHost> CreateRemoteServer( | 110 static std::unique_ptr<LayerTreeHost> CreateRemoteServer( |
111 RemoteProtoChannel* remote_proto_channel, | 111 RemoteProtoChannel* remote_proto_channel, |
112 InitParams* params); | 112 InitParams* params); |
113 | 113 |
114 // The lifetime of this LayerTreeHost is tied to the lifetime of the remote | 114 // The lifetime of this LayerTreeHost is tied to the lifetime of the remote |
115 // server LayerTreeHost. It should be created on receiving | 115 // server LayerTreeHost. It should be created on receiving |
116 // CompositorMessageToImpl::InitializeImpl message and destroyed on receiving | 116 // CompositorMessageToImpl::InitializeImpl message and destroyed on receiving |
117 // a CompositorMessageToImpl::CloseImpl message from the server. This ensures | 117 // a CompositorMessageToImpl::CloseImpl message from the server. This ensures |
118 // that the client will not send any compositor messages once the | 118 // that the client will not send any compositor messages once the |
119 // LayerTreeHost on the server is destroyed. | 119 // LayerTreeHost on the server is destroyed. |
120 static scoped_ptr<LayerTreeHost> CreateRemoteClient( | 120 static std::unique_ptr<LayerTreeHost> CreateRemoteClient( |
121 RemoteProtoChannel* remote_proto_channel, | 121 RemoteProtoChannel* remote_proto_channel, |
122 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 122 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
123 InitParams* params); | 123 InitParams* params); |
124 | 124 |
125 virtual ~LayerTreeHost(); | 125 virtual ~LayerTreeHost(); |
126 | 126 |
127 // LayerTreeHost interface to Proxy. | 127 // LayerTreeHost interface to Proxy. |
128 void WillBeginMainFrame(); | 128 void WillBeginMainFrame(); |
129 void DidBeginMainFrame(); | 129 void DidBeginMainFrame(); |
130 void BeginMainFrame(const BeginFrameArgs& args); | 130 void BeginMainFrame(const BeginFrameArgs& args); |
131 void BeginMainFrameNotExpectedSoon(); | 131 void BeginMainFrameNotExpectedSoon(); |
132 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); | 132 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); |
133 void DidStopFlinging(); | 133 void DidStopFlinging(); |
134 void RequestMainFrameUpdate(); | 134 void RequestMainFrameUpdate(); |
135 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); | 135 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); |
136 void WillCommit(); | 136 void WillCommit(); |
137 void CommitComplete(); | 137 void CommitComplete(); |
138 void SetOutputSurface(scoped_ptr<OutputSurface> output_surface); | 138 void SetOutputSurface(std::unique_ptr<OutputSurface> output_surface); |
139 scoped_ptr<OutputSurface> ReleaseOutputSurface(); | 139 std::unique_ptr<OutputSurface> ReleaseOutputSurface(); |
140 void RequestNewOutputSurface(); | 140 void RequestNewOutputSurface(); |
141 void DidInitializeOutputSurface(); | 141 void DidInitializeOutputSurface(); |
142 void DidFailToInitializeOutputSurface(); | 142 void DidFailToInitializeOutputSurface(); |
143 virtual scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( | 143 virtual std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( |
144 LayerTreeHostImplClient* client); | 144 LayerTreeHostImplClient* client); |
145 void DidLoseOutputSurface(); | 145 void DidLoseOutputSurface(); |
146 bool output_surface_lost() const { return output_surface_lost_; } | 146 bool output_surface_lost() const { return output_surface_lost_; } |
147 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } | 147 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } |
148 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } | 148 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } |
149 bool UpdateLayers(); | 149 bool UpdateLayers(); |
150 | 150 |
151 // Called when the compositor completed page scale animation. | 151 // Called when the compositor completed page scale animation. |
152 void DidCompletePageScaleAnimation(); | 152 void DidCompletePageScaleAnimation(); |
153 | 153 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 bool needs_meta_info_recomputation); | 199 bool needs_meta_info_recomputation); |
200 void SetNeedsRedraw(); | 200 void SetNeedsRedraw(); |
201 void SetNeedsRedrawRect(const gfx::Rect& damage_rect); | 201 void SetNeedsRedrawRect(const gfx::Rect& damage_rect); |
202 bool CommitRequested() const; | 202 bool CommitRequested() const; |
203 bool BeginMainFrameRequested() const; | 203 bool BeginMainFrameRequested() const; |
204 | 204 |
205 void SetNextCommitWaitsForActivation(); | 205 void SetNextCommitWaitsForActivation(); |
206 | 206 |
207 void SetNextCommitForcesRedraw(); | 207 void SetNextCommitForcesRedraw(); |
208 | 208 |
209 void SetAnimationEvents(scoped_ptr<AnimationEvents> events); | 209 void SetAnimationEvents(std::unique_ptr<AnimationEvents> events); |
210 | 210 |
211 void SetRootLayer(scoped_refptr<Layer> root_layer); | 211 void SetRootLayer(scoped_refptr<Layer> root_layer); |
212 Layer* root_layer() { return root_layer_.get(); } | 212 Layer* root_layer() { return root_layer_.get(); } |
213 const Layer* root_layer() const { return root_layer_.get(); } | 213 const Layer* root_layer() const { return root_layer_.get(); } |
214 const Layer* overscroll_elasticity_layer() const { | 214 const Layer* overscroll_elasticity_layer() const { |
215 return overscroll_elasticity_layer_.get(); | 215 return overscroll_elasticity_layer_.get(); |
216 } | 216 } |
217 const Layer* page_scale_layer() const { return page_scale_layer_.get(); } | 217 const Layer* page_scale_layer() const { return page_scale_layer_.get(); } |
218 void RegisterViewportLayers(scoped_refptr<Layer> overscroll_elasticity_layer, | 218 void RegisterViewportLayers(scoped_refptr<Layer> overscroll_elasticity_layer, |
219 scoped_refptr<Layer> page_scale_layer, | 219 scoped_refptr<Layer> page_scale_layer, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // were evicted on the impl thread. | 313 // were evicted on the impl thread. |
314 void RecreateUIResources(); | 314 void RecreateUIResources(); |
315 | 315 |
316 virtual gfx::Size GetUIResourceSize(UIResourceId id) const; | 316 virtual gfx::Size GetUIResourceSize(UIResourceId id) const; |
317 | 317 |
318 bool UsingSharedMemoryResources(); | 318 bool UsingSharedMemoryResources(); |
319 int id() const { return id_; } | 319 int id() const { return id_; } |
320 | 320 |
321 // Returns the id of the benchmark on success, 0 otherwise. | 321 // Returns the id of the benchmark on success, 0 otherwise. |
322 int ScheduleMicroBenchmark(const std::string& benchmark_name, | 322 int ScheduleMicroBenchmark(const std::string& benchmark_name, |
323 scoped_ptr<base::Value> value, | 323 std::unique_ptr<base::Value> value, |
324 const MicroBenchmark::DoneCallback& callback); | 324 const MicroBenchmark::DoneCallback& callback); |
325 // Returns true if the message was successfully delivered and handled. | 325 // Returns true if the message was successfully delivered and handled. |
326 bool SendMessageToMicroBenchmark(int id, scoped_ptr<base::Value> value); | 326 bool SendMessageToMicroBenchmark(int id, std::unique_ptr<base::Value> value); |
327 | 327 |
328 // When a SwapPromiseMonitor is created on the main thread, it calls | 328 // When a SwapPromiseMonitor is created on the main thread, it calls |
329 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. | 329 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. |
330 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | 330 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() |
331 // to unregister itself. | 331 // to unregister itself. |
332 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 332 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
333 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 333 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
334 | 334 |
335 // Call this function when you expect there to be a swap buffer. | 335 // Call this function when you expect there to be a swap buffer. |
336 // See swap_promise.h for how to use SwapPromise. | 336 // See swap_promise.h for how to use SwapPromise. |
337 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 337 void QueueSwapPromise(std::unique_ptr<SwapPromise> swap_promise); |
338 | 338 |
339 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 339 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
340 | 340 |
341 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } | 341 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } |
342 | 342 |
343 void set_surface_id_namespace(uint32_t id_namespace); | 343 void set_surface_id_namespace(uint32_t id_namespace); |
344 SurfaceSequence CreateSurfaceSequence(); | 344 SurfaceSequence CreateSurfaceSequence(); |
345 | 345 |
346 void SetChildrenNeedBeginFrames(bool children_need_begin_frames) const; | 346 void SetChildrenNeedBeginFrames(bool children_need_begin_frames) const; |
347 void SendBeginFramesToChildren(const BeginFrameArgs& args) const; | 347 void SendBeginFramesToChildren(const BeginFrameArgs& args) const; |
348 | 348 |
349 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); | 349 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); |
350 | 350 |
351 PropertyTrees* property_trees() { return &property_trees_; } | 351 PropertyTrees* property_trees() { return &property_trees_; } |
352 bool needs_meta_info_recomputation() { | 352 bool needs_meta_info_recomputation() { |
353 return needs_meta_info_recomputation_; | 353 return needs_meta_info_recomputation_; |
354 } | 354 } |
355 | 355 |
356 void RecordFrameTimingEvents( | 356 void RecordFrameTimingEvents( |
357 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 357 std::unique_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
358 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events); | 358 std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> |
| 359 main_frame_events); |
359 | 360 |
360 Layer* LayerById(int id) const; | 361 Layer* LayerById(int id) const; |
361 | 362 |
362 void AddLayerShouldPushProperties(Layer* layer); | 363 void AddLayerShouldPushProperties(Layer* layer); |
363 void RemoveLayerShouldPushProperties(Layer* layer); | 364 void RemoveLayerShouldPushProperties(Layer* layer); |
364 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); | 365 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); |
365 bool LayerNeedsPushPropertiesForTesting(Layer* layer); | 366 bool LayerNeedsPushPropertiesForTesting(Layer* layer); |
366 | 367 |
367 void RegisterLayer(Layer* layer); | 368 void RegisterLayer(Layer* layer); |
368 void UnregisterLayer(Layer* layer); | 369 void UnregisterLayer(Layer* layer); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 424 |
424 ImageSerializationProcessor* image_serialization_processor() const { | 425 ImageSerializationProcessor* image_serialization_processor() const { |
425 return image_serialization_processor_; | 426 return image_serialization_processor_; |
426 } | 427 } |
427 | 428 |
428 protected: | 429 protected: |
429 LayerTreeHost(InitParams* params, CompositorMode mode); | 430 LayerTreeHost(InitParams* params, CompositorMode mode); |
430 void InitializeThreaded( | 431 void InitializeThreaded( |
431 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 432 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
432 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 433 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
433 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 434 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
434 void InitializeSingleThreaded( | 435 void InitializeSingleThreaded( |
435 LayerTreeHostSingleThreadClient* single_thread_client, | 436 LayerTreeHostSingleThreadClient* single_thread_client, |
436 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 437 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
437 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 438 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
438 void InitializeRemoteServer( | 439 void InitializeRemoteServer( |
439 RemoteProtoChannel* remote_proto_channel, | 440 RemoteProtoChannel* remote_proto_channel, |
440 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 441 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
441 void InitializeRemoteClient( | 442 void InitializeRemoteClient( |
442 RemoteProtoChannel* remote_proto_channel, | 443 RemoteProtoChannel* remote_proto_channel, |
443 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 444 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
444 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 445 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
445 void InitializeForTesting( | 446 void InitializeForTesting( |
446 scoped_ptr<TaskRunnerProvider> task_runner_provider, | 447 std::unique_ptr<TaskRunnerProvider> task_runner_provider, |
447 scoped_ptr<Proxy> proxy_for_testing, | 448 std::unique_ptr<Proxy> proxy_for_testing, |
448 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 449 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
449 void SetOutputSurfaceLostForTesting(bool is_lost) { | 450 void SetOutputSurfaceLostForTesting(bool is_lost) { |
450 output_surface_lost_ = is_lost; | 451 output_surface_lost_ = is_lost; |
451 } | 452 } |
452 void SetTaskRunnerProviderForTesting( | 453 void SetTaskRunnerProviderForTesting( |
453 scoped_ptr<TaskRunnerProvider> task_runner_provider); | 454 std::unique_ptr<TaskRunnerProvider> task_runner_provider); |
454 | 455 |
455 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and | 456 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and |
456 // task_graph_runner() return valid values only until the LayerTreeHostImpl is | 457 // task_graph_runner() return valid values only until the LayerTreeHostImpl is |
457 // created in CreateLayerTreeHostImpl(). | 458 // created in CreateLayerTreeHostImpl(). |
458 SharedBitmapManager* shared_bitmap_manager() const { | 459 SharedBitmapManager* shared_bitmap_manager() const { |
459 return shared_bitmap_manager_; | 460 return shared_bitmap_manager_; |
460 } | 461 } |
461 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { | 462 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { |
462 return gpu_memory_buffer_manager_; | 463 return gpu_memory_buffer_manager_; |
463 } | 464 } |
464 TaskGraphRunner* task_graph_runner() const { return task_graph_runner_; } | 465 TaskGraphRunner* task_graph_runner() const { return task_graph_runner_; } |
465 | 466 |
466 MicroBenchmarkController micro_benchmark_controller_; | 467 MicroBenchmarkController micro_benchmark_controller_; |
467 | 468 |
468 void OnCommitForSwapPromises(); | 469 void OnCommitForSwapPromises(); |
469 | 470 |
470 void RecordGpuRasterizationHistogram(); | 471 void RecordGpuRasterizationHistogram(); |
471 | 472 |
472 private: | 473 private: |
473 friend class LayerTreeHostSerializationTest; | 474 friend class LayerTreeHostSerializationTest; |
474 | 475 |
475 void InitializeProxy( | 476 void InitializeProxy( |
476 scoped_ptr<Proxy> proxy, | 477 std::unique_ptr<Proxy> proxy, |
477 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 478 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
478 | 479 |
479 bool DoUpdateLayers(Layer* root_layer); | 480 bool DoUpdateLayers(Layer* root_layer); |
480 void UpdateHudLayer(); | 481 void UpdateHudLayer(); |
481 | 482 |
482 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); | 483 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); |
483 | 484 |
484 struct UIResourceClientData { | 485 struct UIResourceClientData { |
485 UIResourceClient* client; | 486 UIResourceClient* client; |
486 gfx::Size size; | 487 gfx::Size size; |
487 }; | 488 }; |
(...skipping 11 matching lines...) Expand all Loading... |
499 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); | 500 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); |
500 | 501 |
501 void SetPropertyTreesNeedRebuild(); | 502 void SetPropertyTreesNeedRebuild(); |
502 | 503 |
503 const CompositorMode compositor_mode_; | 504 const CompositorMode compositor_mode_; |
504 | 505 |
505 bool needs_full_tree_sync_; | 506 bool needs_full_tree_sync_; |
506 bool needs_meta_info_recomputation_; | 507 bool needs_meta_info_recomputation_; |
507 | 508 |
508 LayerTreeHostClient* client_; | 509 LayerTreeHostClient* client_; |
509 scoped_ptr<Proxy> proxy_; | 510 std::unique_ptr<Proxy> proxy_; |
510 scoped_ptr<TaskRunnerProvider> task_runner_provider_; | 511 std::unique_ptr<TaskRunnerProvider> task_runner_provider_; |
511 | 512 |
512 int source_frame_number_; | 513 int source_frame_number_; |
513 int meta_information_sequence_number_; | 514 int meta_information_sequence_number_; |
514 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_; | 515 std::unique_ptr<RenderingStatsInstrumentation> |
| 516 rendering_stats_instrumentation_; |
515 | 517 |
516 // |current_output_surface_| can't be updated until we've successfully | 518 // |current_output_surface_| can't be updated until we've successfully |
517 // initialized a new output surface. |new_output_surface_| contains the | 519 // initialized a new output surface. |new_output_surface_| contains the |
518 // new output surface that is currently being initialized. If initialization | 520 // new output surface that is currently being initialized. If initialization |
519 // is successful then |new_output_surface_| replaces | 521 // is successful then |new_output_surface_| replaces |
520 // |current_output_surface_|. | 522 // |current_output_surface_|. |
521 scoped_ptr<OutputSurface> new_output_surface_; | 523 std::unique_ptr<OutputSurface> new_output_surface_; |
522 scoped_ptr<OutputSurface> current_output_surface_; | 524 std::unique_ptr<OutputSurface> current_output_surface_; |
523 bool output_surface_lost_; | 525 bool output_surface_lost_; |
524 | 526 |
525 scoped_refptr<Layer> root_layer_; | 527 scoped_refptr<Layer> root_layer_; |
526 scoped_refptr<HeadsUpDisplayLayer> hud_layer_; | 528 scoped_refptr<HeadsUpDisplayLayer> hud_layer_; |
527 | 529 |
528 base::WeakPtr<InputHandler> input_handler_weak_ptr_; | 530 base::WeakPtr<InputHandler> input_handler_weak_ptr_; |
529 | 531 |
530 const LayerTreeSettings settings_; | 532 const LayerTreeSettings settings_; |
531 LayerTreeDebugState debug_state_; | 533 LayerTreeDebugState debug_state_; |
532 | 534 |
(...skipping 14 matching lines...) Expand all Loading... |
547 bool content_is_suitable_for_gpu_rasterization_; | 549 bool content_is_suitable_for_gpu_rasterization_; |
548 bool gpu_rasterization_histogram_recorded_; | 550 bool gpu_rasterization_histogram_recorded_; |
549 | 551 |
550 SkColor background_color_; | 552 SkColor background_color_; |
551 bool has_transparent_background_; | 553 bool has_transparent_background_; |
552 | 554 |
553 bool have_scroll_event_handlers_; | 555 bool have_scroll_event_handlers_; |
554 EventListenerProperties event_listener_properties_[static_cast<size_t>( | 556 EventListenerProperties event_listener_properties_[static_cast<size_t>( |
555 EventListenerClass::kNumClasses)]; | 557 EventListenerClass::kNumClasses)]; |
556 | 558 |
557 scoped_ptr<AnimationHost> animation_host_; | 559 std::unique_ptr<AnimationHost> animation_host_; |
558 | 560 |
559 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 561 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
560 | 562 |
561 // If set, then page scale animation has completed, but the client hasn't been | 563 // If set, then page scale animation has completed, but the client hasn't been |
562 // notified about it yet. | 564 // notified about it yet. |
563 bool did_complete_scale_animation_; | 565 bool did_complete_scale_animation_; |
564 | 566 |
565 bool in_paint_layer_contents_; | 567 bool in_paint_layer_contents_; |
566 | 568 |
567 int id_; | 569 int id_; |
568 bool next_commit_forces_redraw_; | 570 bool next_commit_forces_redraw_; |
569 | 571 |
570 scoped_refptr<Layer> overscroll_elasticity_layer_; | 572 scoped_refptr<Layer> overscroll_elasticity_layer_; |
571 scoped_refptr<Layer> page_scale_layer_; | 573 scoped_refptr<Layer> page_scale_layer_; |
572 scoped_refptr<Layer> inner_viewport_scroll_layer_; | 574 scoped_refptr<Layer> inner_viewport_scroll_layer_; |
573 scoped_refptr<Layer> outer_viewport_scroll_layer_; | 575 scoped_refptr<Layer> outer_viewport_scroll_layer_; |
574 | 576 |
575 LayerSelection selection_; | 577 LayerSelection selection_; |
576 | 578 |
577 SharedBitmapManager* shared_bitmap_manager_; | 579 SharedBitmapManager* shared_bitmap_manager_; |
578 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 580 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
579 TaskGraphRunner* task_graph_runner_; | 581 TaskGraphRunner* task_graph_runner_; |
580 | 582 |
581 ImageSerializationProcessor* image_serialization_processor_; | 583 ImageSerializationProcessor* image_serialization_processor_; |
582 | 584 |
583 std::vector<scoped_ptr<SwapPromise>> swap_promise_list_; | 585 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; |
584 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 586 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
585 | 587 |
586 PropertyTrees property_trees_; | 588 PropertyTrees property_trees_; |
587 | 589 |
588 using LayerIdMap = std::unordered_map<int, Layer*>; | 590 using LayerIdMap = std::unordered_map<int, Layer*>; |
589 LayerIdMap layer_id_map_; | 591 LayerIdMap layer_id_map_; |
590 // Set of layers that need to push properties. | 592 // Set of layers that need to push properties. |
591 std::unordered_set<Layer*> layers_that_should_push_properties_; | 593 std::unordered_set<Layer*> layers_that_should_push_properties_; |
592 | 594 |
593 uint32_t surface_id_namespace_; | 595 uint32_t surface_id_namespace_; |
594 uint32_t next_surface_sequence_; | 596 uint32_t next_surface_sequence_; |
595 | 597 |
596 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 598 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
597 }; | 599 }; |
598 | 600 |
599 } // namespace cc | 601 } // namespace cc |
600 | 602 |
601 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 603 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |