| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_H_ | 5 #ifndef CC_TREES_LAYER_TREE_H_ |
| 6 #define CC_TREES_LAYER_TREE_H_ | 6 #define CC_TREES_LAYER_TREE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <unordered_set> | 10 #include <unordered_set> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 class AnimationHost; | 36 class AnimationHost; |
| 37 class ClientPictureCache; | 37 class ClientPictureCache; |
| 38 class EnginePictureCache; | 38 class EnginePictureCache; |
| 39 class HeadsUpDisplayLayer; | 39 class HeadsUpDisplayLayer; |
| 40 class Layer; | 40 class Layer; |
| 41 class LayerTreeHost; | 41 class LayerTreeHost; |
| 42 class LayerTreeImpl; | 42 class LayerTreeImpl; |
| 43 class LayerTreeSettings; | 43 class LayerTreeSettings; |
| 44 struct PendingPageScaleAnimation; | 44 struct PendingPageScaleAnimation; |
| 45 struct ReflectedMainFrameState; |
| 45 class UIResourceManager; | 46 class UIResourceManager; |
| 46 class SwapPromiseManager; | 47 class SwapPromiseManager; |
| 47 class SurfaceSequenceGenerator; | 48 class SurfaceSequenceGenerator; |
| 48 | 49 |
| 49 class CC_EXPORT LayerTree : public MutatorHostClient { | 50 class CC_EXPORT LayerTree : public MutatorHostClient { |
| 50 public: | 51 public: |
| 51 using LayerSet = std::unordered_set<Layer*>; | 52 using LayerSet = std::unordered_set<Layer*>; |
| 52 using LayerIdMap = std::unordered_map<int, Layer*>; | 53 using LayerIdMap = std::unordered_map<int, Layer*>; |
| 53 | 54 |
| 54 LayerTree(std::unique_ptr<AnimationHost> animation_host, | 55 LayerTree(std::unique_ptr<AnimationHost> animation_host, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 96 } |
| 96 | 97 |
| 97 void SetTopControlsHeight(float height, bool shrink); | 98 void SetTopControlsHeight(float height, bool shrink); |
| 98 void SetTopControlsShownRatio(float ratio); | 99 void SetTopControlsShownRatio(float ratio); |
| 99 void SetBottomControlsHeight(float height); | 100 void SetBottomControlsHeight(float height); |
| 100 | 101 |
| 101 void SetPageScaleFactorAndLimits(float page_scale_factor, | 102 void SetPageScaleFactorAndLimits(float page_scale_factor, |
| 102 float min_page_scale_factor, | 103 float min_page_scale_factor, |
| 103 float max_page_scale_factor); | 104 float max_page_scale_factor); |
| 104 float page_scale_factor() const { return inputs_.page_scale_factor; } | 105 float page_scale_factor() const { return inputs_.page_scale_factor; } |
| 106 float min_page_scale_factor() const { return inputs_.min_page_scale_factor; } |
| 107 float max_page_scale_factor() const { return inputs_.max_page_scale_factor; } |
| 105 | 108 |
| 106 void set_background_color(SkColor color) { inputs_.background_color = color; } | 109 void set_background_color(SkColor color) { inputs_.background_color = color; } |
| 107 SkColor background_color() const { return inputs_.background_color; } | 110 SkColor background_color() const { return inputs_.background_color; } |
| 108 | 111 |
| 109 void set_has_transparent_background(bool transparent) { | 112 void set_has_transparent_background(bool transparent) { |
| 110 inputs_.has_transparent_background = transparent; | 113 inputs_.has_transparent_background = transparent; |
| 111 } | 114 } |
| 112 | 115 |
| 113 void StartPageScaleAnimation(const gfx::Vector2d& target_offset, | 116 void StartPageScaleAnimation(const gfx::Vector2d& target_offset, |
| 114 bool use_anchor, | 117 bool use_anchor, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 125 const gfx::ColorSpace& device_color_space() const { | 128 const gfx::ColorSpace& device_color_space() const { |
| 126 return inputs_.device_color_space; | 129 return inputs_.device_color_space; |
| 127 } | 130 } |
| 128 | 131 |
| 129 // Used externally by blink for setting the PropertyTrees when | 132 // Used externally by blink for setting the PropertyTrees when |
| 130 // |settings_.use_layer_lists| is true. This is a SPV2 setting. | 133 // |settings_.use_layer_lists| is true. This is a SPV2 setting. |
| 131 PropertyTrees* property_trees() { return &property_trees_; } | 134 PropertyTrees* property_trees() { return &property_trees_; } |
| 132 | 135 |
| 133 void SetNeedsDisplayOnAllLayers(); | 136 void SetNeedsDisplayOnAllLayers(); |
| 134 | 137 |
| 138 void SetReflectedMainFrameState( |
| 139 std::unique_ptr<ReflectedMainFrameState> reflected_main_frame_state); |
| 140 |
| 135 void SetNeedsCommit(); | 141 void SetNeedsCommit(); |
| 136 | 142 |
| 137 const LayerTreeSettings& GetSettings() const; | 143 const LayerTreeSettings& GetSettings() const; |
| 138 | 144 |
| 139 // Methods which should only be used internally in cc ------------------ | 145 // Methods which should only be used internally in cc ------------------ |
| 140 void RegisterLayer(Layer* layer); | 146 void RegisterLayer(Layer* layer); |
| 141 void UnregisterLayer(Layer* layer); | 147 void UnregisterLayer(Layer* layer); |
| 142 Layer* LayerById(int id) const; | 148 Layer* LayerById(int id) const; |
| 143 | 149 |
| 144 bool UpdateLayers(const LayerList& update_layer_list, | 150 bool UpdateLayers(const LayerList& update_layer_list, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 273 |
| 268 LayerSelection selection; | 274 LayerSelection selection; |
| 269 | 275 |
| 270 gfx::Size device_viewport_size; | 276 gfx::Size device_viewport_size; |
| 271 | 277 |
| 272 bool have_scroll_event_handlers; | 278 bool have_scroll_event_handlers; |
| 273 EventListenerProperties event_listener_properties[static_cast<size_t>( | 279 EventListenerProperties event_listener_properties[static_cast<size_t>( |
| 274 EventListenerClass::kNumClasses)]; | 280 EventListenerClass::kNumClasses)]; |
| 275 | 281 |
| 276 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation; | 282 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation; |
| 283 |
| 284 std::unique_ptr<ReflectedMainFrameState> reflected_main_frame_state; |
| 277 }; | 285 }; |
| 278 | 286 |
| 279 Inputs inputs_; | 287 Inputs inputs_; |
| 280 | 288 |
| 281 PropertyTrees property_trees_; | 289 PropertyTrees property_trees_; |
| 282 | 290 |
| 283 bool needs_full_tree_sync_; | 291 bool needs_full_tree_sync_; |
| 284 bool needs_meta_info_recomputation_; | 292 bool needs_meta_info_recomputation_; |
| 285 | 293 |
| 286 gfx::Vector2dF elastic_overscroll_; | 294 gfx::Vector2dF elastic_overscroll_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 305 // external embedder. | 313 // external embedder. |
| 306 EnginePictureCache* engine_picture_cache_; | 314 EnginePictureCache* engine_picture_cache_; |
| 307 ClientPictureCache* client_picture_cache_; | 315 ClientPictureCache* client_picture_cache_; |
| 308 | 316 |
| 309 DISALLOW_COPY_AND_ASSIGN(LayerTree); | 317 DISALLOW_COPY_AND_ASSIGN(LayerTree); |
| 310 }; | 318 }; |
| 311 | 319 |
| 312 } // namespace cc | 320 } // namespace cc |
| 313 | 321 |
| 314 #endif // CC_TREES_LAYER_TREE_H_ | 322 #endif // CC_TREES_LAYER_TREE_H_ |
| OLD | NEW |