| 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 <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 class PictureLayerImpl; | 43 class PictureLayerImpl; |
| 44 class Proxy; | 44 class Proxy; |
| 45 class ResourceProvider; | 45 class ResourceProvider; |
| 46 class TileManager; | 46 class TileManager; |
| 47 class UIResourceRequest; | 47 class UIResourceRequest; |
| 48 struct PendingPageScaleAnimation; | 48 struct PendingPageScaleAnimation; |
| 49 struct RendererCapabilities; | 49 struct RendererCapabilities; |
| 50 struct SelectionHandle; | 50 struct SelectionHandle; |
| 51 | 51 |
| 52 typedef std::list<UIResourceRequest> UIResourceRequestQueue; | 52 typedef std::list<UIResourceRequest> UIResourceRequestQueue; |
| 53 typedef SyncedProperty<AdditionGroup<gfx::Vector2dF>> SyncedElasticOverscroll; |
| 53 | 54 |
| 54 class CC_EXPORT LayerTreeImpl { | 55 class CC_EXPORT LayerTreeImpl { |
| 55 public: | 56 public: |
| 56 static scoped_ptr<LayerTreeImpl> create( | 57 static scoped_ptr<LayerTreeImpl> create( |
| 57 LayerTreeHostImpl* layer_tree_host_impl, | 58 LayerTreeHostImpl* layer_tree_host_impl, |
| 58 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor) { | 59 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
| 59 return make_scoped_ptr( | 60 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll) { |
| 60 new LayerTreeImpl(layer_tree_host_impl, page_scale_factor)); | 61 return make_scoped_ptr(new LayerTreeImpl( |
| 62 layer_tree_host_impl, page_scale_factor, elastic_overscroll)); |
| 61 } | 63 } |
| 62 virtual ~LayerTreeImpl(); | 64 virtual ~LayerTreeImpl(); |
| 63 | 65 |
| 64 void Shutdown(); | 66 void Shutdown(); |
| 65 void ReleaseResources(); | 67 void ReleaseResources(); |
| 66 | 68 |
| 67 // Methods called by the layer tree that pass-through or access LTHI. | 69 // Methods called by the layer tree that pass-through or access LTHI. |
| 68 // --------------------------------------------------------------------------- | 70 // --------------------------------------------------------------------------- |
| 69 const LayerTreeSettings& settings() const; | 71 const LayerTreeSettings& settings() const; |
| 70 const RendererCapabilitiesImpl& GetRendererCapabilities() const; | 72 const RendererCapabilitiesImpl& GetRendererCapabilities() const; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 return page_scale_factor()->Current(IsActiveTree()); | 174 return page_scale_factor()->Current(IsActiveTree()); |
| 173 } | 175 } |
| 174 float min_page_scale_factor() const { return min_page_scale_factor_; } | 176 float min_page_scale_factor() const { return min_page_scale_factor_; } |
| 175 float max_page_scale_factor() const { return max_page_scale_factor_; } | 177 float max_page_scale_factor() const { return max_page_scale_factor_; } |
| 176 | 178 |
| 177 float page_scale_delta() const { return page_scale_factor()->Delta(); } | 179 float page_scale_delta() const { return page_scale_factor()->Delta(); } |
| 178 | 180 |
| 179 SyncedProperty<ScaleGroup>* page_scale_factor(); | 181 SyncedProperty<ScaleGroup>* page_scale_factor(); |
| 180 const SyncedProperty<ScaleGroup>* page_scale_factor() const; | 182 const SyncedProperty<ScaleGroup>* page_scale_factor() const; |
| 181 | 183 |
| 184 SyncedElasticOverscroll* elastic_overscroll() { |
| 185 return elastic_overscroll_.get(); |
| 186 } |
| 187 const SyncedElasticOverscroll* elastic_overscroll() const { |
| 188 return elastic_overscroll_.get(); |
| 189 } |
| 190 |
| 182 // Updates draw properties and render surface layer list, as well as tile | 191 // Updates draw properties and render surface layer list, as well as tile |
| 183 // priorities. Returns false if it was unable to update. | 192 // priorities. Returns false if it was unable to update. |
| 184 bool UpdateDrawProperties(); | 193 bool UpdateDrawProperties(); |
| 185 | 194 |
| 186 void set_needs_update_draw_properties() { | 195 void set_needs_update_draw_properties() { |
| 187 needs_update_draw_properties_ = true; | 196 needs_update_draw_properties_ = true; |
| 188 } | 197 } |
| 189 bool needs_update_draw_properties() const { | 198 bool needs_update_draw_properties() const { |
| 190 return needs_update_draw_properties_; | 199 return needs_update_draw_properties_; |
| 191 } | 200 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 return top_controls_content_offset_ + top_controls_delta_; | 327 return top_controls_content_offset_ + top_controls_delta_; |
| 319 } | 328 } |
| 320 | 329 |
| 321 void SetPendingPageScaleAnimation( | 330 void SetPendingPageScaleAnimation( |
| 322 scoped_ptr<PendingPageScaleAnimation> pending_animation); | 331 scoped_ptr<PendingPageScaleAnimation> pending_animation); |
| 323 scoped_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); | 332 scoped_ptr<PendingPageScaleAnimation> TakePendingPageScaleAnimation(); |
| 324 | 333 |
| 325 protected: | 334 protected: |
| 326 explicit LayerTreeImpl( | 335 explicit LayerTreeImpl( |
| 327 LayerTreeHostImpl* layer_tree_host_impl, | 336 LayerTreeHostImpl* layer_tree_host_impl, |
| 328 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor); | 337 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
| 338 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); |
| 329 void ReleaseResourcesRecursive(LayerImpl* current); | 339 void ReleaseResourcesRecursive(LayerImpl* current); |
| 330 float ClampPageScaleFactorToLimits(float page_scale_factor) const; | 340 float ClampPageScaleFactorToLimits(float page_scale_factor) const; |
| 331 void PushPageScaleFactorAndLimits(const float* page_scale_factor, | 341 void PushPageScaleFactorAndLimits(const float* page_scale_factor, |
| 332 float min_page_scale_factor, | 342 float min_page_scale_factor, |
| 333 float max_page_scale_factor); | 343 float max_page_scale_factor); |
| 334 bool SetPageScaleFactorLimits(float min_page_scale_factor, | 344 bool SetPageScaleFactorLimits(float min_page_scale_factor, |
| 335 float max_page_scale_factor); | 345 float max_page_scale_factor); |
| 336 void DidUpdatePageScale(); | 346 void DidUpdatePageScale(); |
| 337 | 347 |
| 338 LayerTreeHostImpl* layer_tree_host_impl_; | 348 LayerTreeHostImpl* layer_tree_host_impl_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 353 LayerImpl* inner_viewport_scroll_layer_; | 363 LayerImpl* inner_viewport_scroll_layer_; |
| 354 LayerImpl* outer_viewport_scroll_layer_; | 364 LayerImpl* outer_viewport_scroll_layer_; |
| 355 | 365 |
| 356 LayerSelectionBound selection_start_; | 366 LayerSelectionBound selection_start_; |
| 357 LayerSelectionBound selection_end_; | 367 LayerSelectionBound selection_end_; |
| 358 | 368 |
| 359 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor_; | 369 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor_; |
| 360 float min_page_scale_factor_; | 370 float min_page_scale_factor_; |
| 361 float max_page_scale_factor_; | 371 float max_page_scale_factor_; |
| 362 | 372 |
| 373 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_; |
| 374 |
| 363 typedef base::hash_map<int, LayerImpl*> LayerIdMap; | 375 typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
| 364 LayerIdMap layer_id_map_; | 376 LayerIdMap layer_id_map_; |
| 365 | 377 |
| 366 std::vector<LayerImpl*> layers_with_copy_output_request_; | 378 std::vector<LayerImpl*> layers_with_copy_output_request_; |
| 367 | 379 |
| 368 // Persisted state for non-impl-side-painting. | 380 // Persisted state for non-impl-side-painting. |
| 369 int scrolling_layer_id_from_previous_tree_; | 381 int scrolling_layer_id_from_previous_tree_; |
| 370 | 382 |
| 371 // List of visible layers for the most recently prepared frame. | 383 // List of visible layers for the most recently prepared frame. |
| 372 LayerImplList render_surface_layer_list_; | 384 LayerImplList render_surface_layer_list_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 403 | 415 |
| 404 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 416 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
| 405 | 417 |
| 406 private: | 418 private: |
| 407 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 419 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 408 }; | 420 }; |
| 409 | 421 |
| 410 } // namespace cc | 422 } // namespace cc |
| 411 | 423 |
| 412 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 424 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
| OLD | NEW |