| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void AsValueInto(base::trace_event::TracedValue* dict) const; | 132 void AsValueInto(base::trace_event::TracedValue* dict) const; |
| 133 | 133 |
| 134 // Other public methods | 134 // Other public methods |
| 135 // --------------------------------------------------------------------------- | 135 // --------------------------------------------------------------------------- |
| 136 LayerImpl* root_layer() const { return root_layer_; } | 136 LayerImpl* root_layer() const { return root_layer_; } |
| 137 void SetRootLayer(std::unique_ptr<LayerImpl>); | 137 void SetRootLayer(std::unique_ptr<LayerImpl>); |
| 138 bool IsRootLayer(const LayerImpl* layer) const; | 138 bool IsRootLayer(const LayerImpl* layer) const; |
| 139 std::unique_ptr<OwnedLayerImplList> DetachLayers(); | 139 std::unique_ptr<OwnedLayerImplList> DetachLayers(); |
| 140 void ClearLayers(); | 140 void ClearLayers(); |
| 141 | 141 |
| 142 void SetPropertyTrees(const PropertyTrees& property_trees) { | 142 void SetPropertyTrees(PropertyTrees* property_trees); |
| 143 property_trees_ = property_trees; | |
| 144 property_trees_.is_main_thread = false; | |
| 145 property_trees_.is_active = IsActiveTree(); | |
| 146 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); | |
| 147 // The value of some effect node properties (like is_drawn) depends on | |
| 148 // whether we are on the active tree or not. So, we need to update the | |
| 149 // effect tree. | |
| 150 if (IsActiveTree()) | |
| 151 property_trees_.effect_tree.set_needs_update(true); | |
| 152 } | |
| 153 PropertyTrees* property_trees() { return &property_trees_; } | 143 PropertyTrees* property_trees() { return &property_trees_; } |
| 154 | 144 |
| 155 void UpdatePropertyTreesForBoundsDelta(); | 145 void UpdatePropertyTreesForBoundsDelta(); |
| 156 | 146 |
| 157 void PushPropertiesTo(LayerTreeImpl* tree_impl); | 147 void PushPropertiesTo(LayerTreeImpl* tree_impl); |
| 158 | 148 |
| 159 void MoveChangeTrackingToLayers(); | 149 void MoveChangeTrackingToLayers(); |
| 160 | 150 |
| 161 LayerListIterator<LayerImpl> begin(); | 151 LayerListIterator<LayerImpl> begin(); |
| 162 LayerListIterator<LayerImpl> end(); | 152 LayerListIterator<LayerImpl> end(); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 return picture_layers_; | 375 return picture_layers_; |
| 386 } | 376 } |
| 387 | 377 |
| 388 void RegisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); | 378 void RegisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); |
| 389 void UnregisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); | 379 void UnregisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); |
| 390 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const; | 380 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const; |
| 391 | 381 |
| 392 void RegisterScrollLayer(LayerImpl* layer); | 382 void RegisterScrollLayer(LayerImpl* layer); |
| 393 void UnregisterScrollLayer(LayerImpl* layer); | 383 void UnregisterScrollLayer(LayerImpl* layer); |
| 394 | 384 |
| 395 void AddLayerWithCopyOutputRequest(LayerImpl* layer); | |
| 396 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); | |
| 397 const std::vector<LayerImpl*>& LayersWithCopyOutputRequest() const; | |
| 398 | |
| 399 void AddSurfaceLayer(LayerImpl* layer); | 385 void AddSurfaceLayer(LayerImpl* layer); |
| 400 void RemoveSurfaceLayer(LayerImpl* layer); | 386 void RemoveSurfaceLayer(LayerImpl* layer); |
| 401 const std::vector<LayerImpl*>& SurfaceLayers() const { | 387 const std::vector<LayerImpl*>& SurfaceLayers() const { |
| 402 return surface_layers_; | 388 return surface_layers_; |
| 403 } | 389 } |
| 404 | 390 |
| 405 LayerImpl* FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint( | 391 LayerImpl* FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint( |
| 406 const gfx::PointF& screen_space_point); | 392 const gfx::PointF& screen_space_point); |
| 407 | 393 |
| 408 LayerImpl* FindLayerThatIsHitByPoint(const gfx::PointF& screen_space_point); | 394 LayerImpl* FindLayerThatIsHitByPoint(const gfx::PointF& screen_space_point); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) | 525 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) |
| 540 std::unordered_map<int, int> clip_scroll_map_; | 526 std::unordered_map<int, int> clip_scroll_map_; |
| 541 | 527 |
| 542 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there | 528 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there |
| 543 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is | 529 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is |
| 544 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid | 530 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid |
| 545 // O(n) walks.) | 531 // O(n) walks.) |
| 546 std::multimap<int, int> scrollbar_map_; | 532 std::multimap<int, int> scrollbar_map_; |
| 547 | 533 |
| 548 std::vector<PictureLayerImpl*> picture_layers_; | 534 std::vector<PictureLayerImpl*> picture_layers_; |
| 549 std::vector<LayerImpl*> layers_with_copy_output_request_; | |
| 550 std::vector<LayerImpl*> surface_layers_; | 535 std::vector<LayerImpl*> surface_layers_; |
| 551 | 536 |
| 552 // List of visible layers for the most recently prepared frame. | 537 // List of visible layers for the most recently prepared frame. |
| 553 LayerImplList render_surface_layer_list_; | 538 LayerImplList render_surface_layer_list_; |
| 554 // After drawing the |render_surface_layer_list_| the areas in this region | 539 // After drawing the |render_surface_layer_list_| the areas in this region |
| 555 // would not be fully covered by opaque content. | 540 // would not be fully covered by opaque content. |
| 556 Region unoccluded_screen_space_region_; | 541 Region unoccluded_screen_space_region_; |
| 557 | 542 |
| 558 bool viewport_size_invalid_; | 543 bool viewport_size_invalid_; |
| 559 bool needs_update_draw_properties_; | 544 bool needs_update_draw_properties_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 586 | 571 |
| 587 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 572 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
| 588 | 573 |
| 589 private: | 574 private: |
| 590 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 575 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 591 }; | 576 }; |
| 592 | 577 |
| 593 } // namespace cc | 578 } // namespace cc |
| 594 | 579 |
| 595 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 580 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
| OLD | NEW |