OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "cc/base/scoped_ptr_vector.h" | 14 #include "cc/base/scoped_ptr_vector.h" |
15 #include "cc/base/swap_promise.h" | 15 #include "cc/base/swap_promise.h" |
16 #include "cc/base/synced_property.h" | 16 #include "cc/base/synced_property.h" |
17 #include "cc/layers/layer_impl.h" | 17 #include "cc/layers/layer_impl.h" |
18 #include "cc/output/renderer.h" | 18 #include "cc/output/renderer.h" |
19 #include "cc/resources/ui_resource_client.h" | 19 #include "cc/resources/ui_resource_client.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 namespace debug { | 22 namespace trace_event { |
23 class TracedValue; | 23 class TracedValue; |
24 } | 24 } |
| 25 |
| 26 // TODO(ssid): remove these aliases after the tracing clients are moved to the |
| 27 // new trace_event namespace. See crbug.com/451032. ETA: March 2015 |
| 28 namespace debug { |
| 29 using ::base::trace_event::TracedValue; |
25 } | 30 } |
| 31 } // namespace base |
26 | 32 |
27 namespace cc { | 33 namespace cc { |
28 | 34 |
29 class ContextProvider; | 35 class ContextProvider; |
30 class DebugRectHistory; | 36 class DebugRectHistory; |
31 class FrameRateCounter; | 37 class FrameRateCounter; |
32 class HeadsUpDisplayLayerImpl; | 38 class HeadsUpDisplayLayerImpl; |
33 class LayerScrollOffsetDelegateProxy; | 39 class LayerScrollOffsetDelegateProxy; |
34 class LayerTreeDebugState; | 40 class LayerTreeDebugState; |
35 class LayerTreeHostImpl; | 41 class LayerTreeHostImpl; |
(...skipping 21 matching lines...) Expand all Loading... |
57 LayerTreeHostImpl* layer_tree_host_impl, | 63 LayerTreeHostImpl* layer_tree_host_impl, |
58 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, | 64 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
59 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll) { | 65 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll) { |
60 return make_scoped_ptr(new LayerTreeImpl( | 66 return make_scoped_ptr(new LayerTreeImpl( |
61 layer_tree_host_impl, page_scale_factor, elastic_overscroll)); | 67 layer_tree_host_impl, page_scale_factor, elastic_overscroll)); |
62 } | 68 } |
63 virtual ~LayerTreeImpl(); | 69 virtual ~LayerTreeImpl(); |
64 | 70 |
65 void Shutdown(); | 71 void Shutdown(); |
66 void ReleaseResources(); | 72 void ReleaseResources(); |
| 73 void RecreateResources(); |
67 | 74 |
68 // Methods called by the layer tree that pass-through or access LTHI. | 75 // Methods called by the layer tree that pass-through or access LTHI. |
69 // --------------------------------------------------------------------------- | 76 // --------------------------------------------------------------------------- |
70 const LayerTreeSettings& settings() const; | 77 const LayerTreeSettings& settings() const; |
71 const RendererCapabilitiesImpl& GetRendererCapabilities() const; | 78 const RendererCapabilitiesImpl& GetRendererCapabilities() const; |
72 ContextProvider* context_provider() const; | 79 ContextProvider* context_provider() const; |
73 OutputSurface* output_surface() const; | 80 OutputSurface* output_surface() const; |
74 ResourceProvider* resource_provider() const; | 81 ResourceProvider* resource_provider() const; |
75 TileManager* tile_manager() const; | 82 TileManager* tile_manager() const; |
76 FrameRateCounter* frame_rate_counter() const; | 83 FrameRateCounter* frame_rate_counter() const; |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 336 |
330 void SetPendingPageScaleAnimation( | 337 void SetPendingPageScaleAnimation( |
331 scoped_ptr<PendingPageScaleAnimation> pending_animation); | 338 scoped_ptr<PendingPageScaleAnimation> pending_animation); |
332 scoped_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); | 339 scoped_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); |
333 | 340 |
334 protected: | 341 protected: |
335 explicit LayerTreeImpl( | 342 explicit LayerTreeImpl( |
336 LayerTreeHostImpl* layer_tree_host_impl, | 343 LayerTreeHostImpl* layer_tree_host_impl, |
337 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, | 344 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
338 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); | 345 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); |
339 void ReleaseResourcesRecursive(LayerImpl* current); | 346 void ProcessLayersRecursive(LayerImpl* current, |
| 347 void (LayerImpl::*function)()); |
340 float ClampPageScaleFactorToLimits(float page_scale_factor) const; | 348 float ClampPageScaleFactorToLimits(float page_scale_factor) const; |
341 void PushPageScaleFactorAndLimits(const float* page_scale_factor, | 349 void PushPageScaleFactorAndLimits(const float* page_scale_factor, |
342 float min_page_scale_factor, | 350 float min_page_scale_factor, |
343 float max_page_scale_factor); | 351 float max_page_scale_factor); |
344 bool SetPageScaleFactorLimits(float min_page_scale_factor, | 352 bool SetPageScaleFactorLimits(float min_page_scale_factor, |
345 float max_page_scale_factor); | 353 float max_page_scale_factor); |
346 void DidUpdatePageScale(); | 354 void DidUpdatePageScale(); |
347 void HideInnerViewportScrollbarsIfNearMinimumScale(); | 355 void HideInnerViewportScrollbarsIfNearMinimumScale(); |
348 | 356 |
349 LayerTreeHostImpl* layer_tree_host_impl_; | 357 LayerTreeHostImpl* layer_tree_host_impl_; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 424 |
417 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 425 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
418 | 426 |
419 private: | 427 private: |
420 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 428 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
421 }; | 429 }; |
422 | 430 |
423 } // namespace cc | 431 } // namespace cc |
424 | 432 |
425 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 433 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |