| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace trace_event { | 30 namespace trace_event { |
| 31 class TracedValue; | 31 class TracedValue; |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace cc { | 35 namespace cc { |
| 36 | 36 |
| 37 class ContextProvider; | 37 class ContextProvider; |
| 38 class DebugRectHistory; | 38 class DebugRectHistory; |
| 39 class FrameRateCounter; | 39 class FrameRateCounter; |
| 40 class ElementLayers; |
| 40 class HeadsUpDisplayLayerImpl; | 41 class HeadsUpDisplayLayerImpl; |
| 41 class LayerExternalScrollOffsetListener; | 42 class LayerExternalScrollOffsetListener; |
| 42 class LayerScrollOffsetDelegate; | 43 class LayerScrollOffsetDelegate; |
| 43 class LayerTreeDebugState; | 44 class LayerTreeDebugState; |
| 44 class LayerTreeImpl; | 45 class LayerTreeImpl; |
| 45 class LayerTreeSettings; | 46 class LayerTreeSettings; |
| 46 class MemoryHistory; | 47 class MemoryHistory; |
| 47 class OutputSurface; | 48 class OutputSurface; |
| 48 class PageScaleAnimation; | 49 class PageScaleAnimation; |
| 49 class PictureLayerImpl; | 50 class PictureLayerImpl; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 scoped_ptr<ScrollbarAnimationController> CreateScrollbarAnimationController( | 109 scoped_ptr<ScrollbarAnimationController> CreateScrollbarAnimationController( |
| 109 int scroll_layer_id); | 110 int scroll_layer_id); |
| 110 void DidAnimateScrollOffset(); | 111 void DidAnimateScrollOffset(); |
| 111 void InputScrollAnimationFinished(); | 112 void InputScrollAnimationFinished(); |
| 112 bool use_gpu_rasterization() const; | 113 bool use_gpu_rasterization() const; |
| 113 GpuRasterizationStatus GetGpuRasterizationStatus() const; | 114 GpuRasterizationStatus GetGpuRasterizationStatus() const; |
| 114 bool create_low_res_tiling() const; | 115 bool create_low_res_tiling() const; |
| 115 bool RequiresHighResToDraw() const; | 116 bool RequiresHighResToDraw() const; |
| 116 bool SmoothnessTakesPriority() const; | 117 bool SmoothnessTakesPriority() const; |
| 117 VideoFrameControllerClient* GetVideoFrameControllerClient() const; | 118 VideoFrameControllerClient* GetVideoFrameControllerClient() const; |
| 119 LayerTreeHostImpl* host() const { return layer_tree_host_impl_; } |
| 118 | 120 |
| 119 // Tree specific methods exposed to layer-impl tree. | 121 // Tree specific methods exposed to layer-impl tree. |
| 120 // --------------------------------------------------------------------------- | 122 // --------------------------------------------------------------------------- |
| 121 void SetNeedsRedraw(); | 123 void SetNeedsRedraw(); |
| 122 | 124 |
| 123 // Tracing methods. | 125 // Tracing methods. |
| 124 // --------------------------------------------------------------------------- | 126 // --------------------------------------------------------------------------- |
| 125 void GetAllPrioritizedTilesForTracing( | 127 void GetAllPrioritizedTilesForTracing( |
| 126 std::vector<PrioritizedTile>* prioritized_tiles) const; | 128 std::vector<PrioritizedTile>* prioritized_tiles) const; |
| 127 void AsValueInto(base::trace_event::TracedValue* dict) const; | 129 void AsValueInto(base::trace_event::TracedValue* dict) const; |
| 128 | 130 |
| 129 // Other public methods | 131 // Other public methods |
| 130 // --------------------------------------------------------------------------- | 132 // --------------------------------------------------------------------------- |
| 131 LayerImpl* root_layer() const { return root_layer_.get(); } | 133 LayerImpl* root_layer() const { return root_layer_.get(); } |
| 132 void SetRootLayer(scoped_ptr<LayerImpl>); | 134 void SetRootLayer(scoped_ptr<LayerImpl>); |
| 133 scoped_ptr<LayerImpl> DetachLayerTree(); | 135 scoped_ptr<LayerImpl> DetachLayerTree(); |
| 134 | 136 |
| 135 void SetPropertyTrees(const PropertyTrees& property_trees) { | 137 void SetPropertyTrees(const PropertyTrees& property_trees) { |
| 136 property_trees_ = property_trees; | 138 property_trees_ = property_trees; |
| 137 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); | 139 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); |
| 138 } | 140 } |
| 139 PropertyTrees* property_trees() { return &property_trees_; } | 141 PropertyTrees* property_trees() { return &property_trees_; } |
| 140 | 142 |
| 141 void UpdatePropertyTreesForBoundsDelta(); | 143 void UpdatePropertyTreesForBoundsDelta(); |
| 142 | 144 |
| 143 void PushPropertiesTo(LayerTreeImpl* tree_impl); | 145 void PushPropertiesTo(LayerTreeImpl* tree_impl); |
| 144 | 146 |
| 147 // TODO(sad): This is ... not really nice. Should be cleaner maybe. |
| 148 // vollick: What's wrong with it? Just the names or the fact that we have a |
| 149 // proxy registry on the layer tree host impl? |
| 150 void AddToElementMap(LayerImpl* layer); |
| 151 void RemoveFromElementMap(LayerImpl* layer); |
| 152 |
| 153 struct ElementLayers { |
| 154 LayerImpl* main = nullptr; |
| 155 LayerImpl* scroll = nullptr; |
| 156 }; |
| 157 |
| 158 bool GetMutableLayers(uint64_t element_id, ElementLayers* element_layers); |
| 159 |
| 145 int source_frame_number() const { return source_frame_number_; } | 160 int source_frame_number() const { return source_frame_number_; } |
| 146 void set_source_frame_number(int frame_number) { | 161 void set_source_frame_number(int frame_number) { |
| 147 source_frame_number_ = frame_number; | 162 source_frame_number_ = frame_number; |
| 148 } | 163 } |
| 149 | 164 |
| 150 bool is_first_frame_after_commit() const { | 165 bool is_first_frame_after_commit() const { |
| 151 return source_frame_number_ != is_first_frame_after_commit_tracker_; | 166 return source_frame_number_ != is_first_frame_after_commit_tracker_; |
| 152 } | 167 } |
| 153 | 168 |
| 154 void set_is_first_frame_after_commit(bool is_first_frame_after_commit) { | 169 void set_is_first_frame_after_commit(bool is_first_frame_after_commit) { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 float max_page_scale_factor_; | 485 float max_page_scale_factor_; |
| 471 | 486 |
| 472 float device_scale_factor_; | 487 float device_scale_factor_; |
| 473 float painted_device_scale_factor_; | 488 float painted_device_scale_factor_; |
| 474 | 489 |
| 475 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_; | 490 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_; |
| 476 | 491 |
| 477 typedef base::hash_map<int, LayerImpl*> LayerIdMap; | 492 typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
| 478 LayerIdMap layer_id_map_; | 493 LayerIdMap layer_id_map_; |
| 479 | 494 |
| 495 std::map<uint64_t, ElementLayers> element_layers_map_; |
| 496 |
| 480 // Maps from clip layer ids to scroll layer ids. Note that this only includes | 497 // Maps from clip layer ids to scroll layer ids. Note that this only includes |
| 481 // the subset of clip layers that act as scrolling containers. (This is | 498 // the subset of clip layers that act as scrolling containers. (This is |
| 482 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) | 499 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) |
| 483 base::hash_map<int, int> clip_scroll_map_; | 500 base::hash_map<int, int> clip_scroll_map_; |
| 484 | 501 |
| 485 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there | 502 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there |
| 486 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is | 503 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is |
| 487 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid | 504 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid |
| 488 // O(n) walks.) | 505 // O(n) walks.) |
| 489 std::multimap<int, int> scrollbar_map_; | 506 std::multimap<int, int> scrollbar_map_; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 545 |
| 529 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 546 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
| 530 | 547 |
| 531 private: | 548 private: |
| 532 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 549 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 533 }; | 550 }; |
| 534 | 551 |
| 535 } // namespace cc | 552 } // namespace cc |
| 536 | 553 |
| 537 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 554 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
| OLD | NEW |