| 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 <limits> | 8 #include <limits> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 class TopControlsManager; | 58 class TopControlsManager; |
| 59 class UIResourceRequest; | 59 class UIResourceRequest; |
| 60 struct RenderingStats; | 60 struct RenderingStats; |
| 61 struct ScrollAndScaleSet; | 61 struct ScrollAndScaleSet; |
| 62 | 62 |
| 63 // Provides information on an Impl's rendering capabilities back to the | 63 // Provides information on an Impl's rendering capabilities back to the |
| 64 // LayerTreeHost. | 64 // LayerTreeHost. |
| 65 struct CC_EXPORT RendererCapabilities { | 65 struct CC_EXPORT RendererCapabilities { |
| 66 RendererCapabilities(ResourceFormat best_texture_format, | 66 RendererCapabilities(ResourceFormat best_texture_format, |
| 67 bool allow_partial_texture_updates, | 67 bool allow_partial_texture_updates, |
| 68 bool using_offscreen_context3d, | |
| 69 int max_texture_size, | 68 int max_texture_size, |
| 70 bool using_shared_memory_resources); | 69 bool using_shared_memory_resources); |
| 71 | 70 |
| 72 RendererCapabilities(); | 71 RendererCapabilities(); |
| 73 ~RendererCapabilities(); | 72 ~RendererCapabilities(); |
| 74 | 73 |
| 75 // Duplicate any modification to this list to RendererCapabilitiesImpl. | 74 // Duplicate any modification to this list to RendererCapabilitiesImpl. |
| 76 ResourceFormat best_texture_format; | 75 ResourceFormat best_texture_format; |
| 77 bool allow_partial_texture_updates; | 76 bool allow_partial_texture_updates; |
| 78 bool using_offscreen_context3d; | |
| 79 int max_texture_size; | 77 int max_texture_size; |
| 80 bool using_shared_memory_resources; | 78 bool using_shared_memory_resources; |
| 81 }; | 79 }; |
| 82 | 80 |
| 83 class CC_EXPORT LayerTreeHost { | 81 class CC_EXPORT LayerTreeHost { |
| 84 public: | 82 public: |
| 85 // The SharedBitmapManager will be used on the compositor thread. | 83 // The SharedBitmapManager will be used on the compositor thread. |
| 86 static scoped_ptr<LayerTreeHost> CreateThreaded( | 84 static scoped_ptr<LayerTreeHost> CreateThreaded( |
| 87 LayerTreeHostClient* client, | 85 LayerTreeHostClient* client, |
| 88 SharedBitmapManager* manager, | 86 SharedBitmapManager* manager, |
| 89 const LayerTreeSettings& settings, | 87 const LayerTreeSettings& settings, |
| 90 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 88 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
| 91 | 89 |
| 92 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( | 90 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( |
| 93 LayerTreeHostClient* client, | 91 LayerTreeHostClient* client, |
| 94 LayerTreeHostSingleThreadClient* single_thread_client, | 92 LayerTreeHostSingleThreadClient* single_thread_client, |
| 95 SharedBitmapManager* manager, | 93 SharedBitmapManager* manager, |
| 96 const LayerTreeSettings& settings); | 94 const LayerTreeSettings& settings); |
| 97 virtual ~LayerTreeHost(); | 95 virtual ~LayerTreeHost(); |
| 98 | 96 |
| 99 void SetLayerTreeHostClientReady(); | 97 void SetLayerTreeHostClientReady(); |
| 100 | 98 |
| 101 void set_needs_filter_context() { needs_filter_context_ = true; } | |
| 102 bool needs_offscreen_context() const { | |
| 103 return needs_filter_context_; | |
| 104 } | |
| 105 | |
| 106 // LayerTreeHost interface to Proxy. | 99 // LayerTreeHost interface to Proxy. |
| 107 void WillBeginMainFrame() { | 100 void WillBeginMainFrame() { |
| 108 client_->WillBeginMainFrame(source_frame_number_); | 101 client_->WillBeginMainFrame(source_frame_number_); |
| 109 } | 102 } |
| 110 void DidBeginMainFrame(); | 103 void DidBeginMainFrame(); |
| 111 void UpdateClientAnimations(base::TimeTicks monotonic_frame_begin_time); | 104 void UpdateClientAnimations(base::TimeTicks monotonic_frame_begin_time); |
| 112 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); | 105 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); |
| 113 void DidStopFlinging(); | 106 void DidStopFlinging(); |
| 114 void Layout(); | 107 void Layout(); |
| 115 void BeginCommitOnImplThread(LayerTreeHostImpl* host_impl); | 108 void BeginCommitOnImplThread(LayerTreeHostImpl* host_impl); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 352 |
| 360 typedef std::list<UIResourceRequest> UIResourceRequestQueue; | 353 typedef std::list<UIResourceRequest> UIResourceRequestQueue; |
| 361 UIResourceRequestQueue ui_resource_request_queue_; | 354 UIResourceRequestQueue ui_resource_request_queue_; |
| 362 | 355 |
| 363 void CalculateLCDTextMetricsCallback(Layer* layer); | 356 void CalculateLCDTextMetricsCallback(Layer* layer); |
| 364 | 357 |
| 365 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); | 358 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); |
| 366 | 359 |
| 367 bool animating_; | 360 bool animating_; |
| 368 bool needs_full_tree_sync_; | 361 bool needs_full_tree_sync_; |
| 369 bool needs_filter_context_; | |
| 370 | 362 |
| 371 base::CancelableClosure prepaint_callback_; | 363 base::CancelableClosure prepaint_callback_; |
| 372 | 364 |
| 373 LayerTreeHostClient* client_; | 365 LayerTreeHostClient* client_; |
| 374 scoped_ptr<Proxy> proxy_; | 366 scoped_ptr<Proxy> proxy_; |
| 375 | 367 |
| 376 int source_frame_number_; | 368 int source_frame_number_; |
| 377 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_; | 369 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_; |
| 378 | 370 |
| 379 bool output_surface_can_be_initialized_; | 371 bool output_surface_can_be_initialized_; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 | 445 |
| 454 ScopedPtrVector<SwapPromise> swap_promise_list_; | 446 ScopedPtrVector<SwapPromise> swap_promise_list_; |
| 455 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 447 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 456 | 448 |
| 457 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 449 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 458 }; | 450 }; |
| 459 | 451 |
| 460 } // namespace cc | 452 } // namespace cc |
| 461 | 453 |
| 462 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 454 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
| OLD | NEW |