| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROPERTY_TREE_H_ | 5 #ifndef CC_TREES_PROPERTY_TREE_H_ |
| 6 #define CC_TREES_PROPERTY_TREE_H_ | 6 #define CC_TREES_PROPERTY_TREE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 void SetContentTargetId(int node_id, int content_target_id); | 230 void SetContentTargetId(int node_id, int content_target_id); |
| 231 | 231 |
| 232 const std::vector<TransformCachedNodeData>& cached_data() const { | 232 const std::vector<TransformCachedNodeData>& cached_data() const { |
| 233 return cached_data_; | 233 return cached_data_; |
| 234 } | 234 } |
| 235 | 235 |
| 236 void ToProtobuf(proto::PropertyTree* proto) const; | 236 void ToProtobuf(proto::PropertyTree* proto) const; |
| 237 void FromProtobuf(const proto::PropertyTree& proto, | 237 void FromProtobuf(const proto::PropertyTree& proto, |
| 238 std::unordered_map<int, int>* node_id_to_index_map); | 238 std::unordered_map<int, int>* node_id_to_index_map); |
| 239 | 239 |
| 240 private: | |
| 241 // Returns true iff the node at |desc_id| is a descendant of the node at | |
| 242 // |anc_id|. | |
| 243 bool IsDescendant(int desc_id, int anc_id) const; | |
| 244 | |
| 245 // Computes the combined transform between |source_id| and |dest_id| and | 240 // Computes the combined transform between |source_id| and |dest_id| and |
| 246 // returns false if the inverse of a singular transform was used. These two | 241 // returns false if the inverse of a singular transform was used. These two |
| 247 // nodes must be on the same ancestor chain. | 242 // nodes must be on the same ancestor chain. |
| 248 bool CombineTransformsBetween(int source_id, | 243 bool CombineTransformsBetween(int source_id, |
| 249 int dest_id, | 244 int dest_id, |
| 250 gfx::Transform* transform) const; | 245 gfx::Transform* transform) const; |
| 251 | 246 |
| 252 // Computes the combined inverse transform between |source_id| and |dest_id| | 247 // Computes the combined inverse transform between |source_id| and |dest_id| |
| 253 // and returns false if the inverse of a singular transform was used. These | 248 // and returns false if the inverse of a singular transform was used. These |
| 254 // two nodes must be on the same ancestor chain. | 249 // two nodes must be on the same ancestor chain. |
| 255 bool CombineInversesBetween(int source_id, | 250 bool CombineInversesBetween(int source_id, |
| 256 int dest_id, | 251 int dest_id, |
| 257 gfx::Transform* transform) const; | 252 gfx::Transform* transform) const; |
| 258 | 253 |
| 254 private: |
| 255 // Returns true iff the node at |desc_id| is a descendant of the node at |
| 256 // |anc_id|. |
| 257 bool IsDescendant(int desc_id, int anc_id) const; |
| 258 |
| 259 void UpdateLocalTransform(TransformNode* node); | 259 void UpdateLocalTransform(TransformNode* node); |
| 260 void UpdateScreenSpaceTransform(TransformNode* node, | 260 void UpdateScreenSpaceTransform(TransformNode* node, |
| 261 TransformNode* parent_node, | 261 TransformNode* parent_node, |
| 262 TransformNode* target_node); | 262 TransformNode* target_node); |
| 263 void UpdateSurfaceContentsScale(TransformNode* node); | 263 void UpdateSurfaceContentsScale(TransformNode* node); |
| 264 void UpdateTargetSpaceTransform(TransformNode* node, | 264 void UpdateTargetSpaceTransform(TransformNode* node, |
| 265 TransformNode* target_node); | 265 TransformNode* target_node); |
| 266 void UpdateAnimationProperties(TransformNode* node, | 266 void UpdateAnimationProperties(TransformNode* node, |
| 267 TransformNode* parent_node); | 267 TransformNode* parent_node); |
| 268 void UndoSnapping(TransformNode* node); | 268 void UndoSnapping(TransformNode* node); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 CombinedAnimationScale GetAnimationScales(int transform_node_id, | 537 CombinedAnimationScale GetAnimationScales(int transform_node_id, |
| 538 LayerTreeImpl* layer_tree_impl); | 538 LayerTreeImpl* layer_tree_impl); |
| 539 void SetAnimationScalesForTesting(int transform_id, | 539 void SetAnimationScalesForTesting(int transform_id, |
| 540 float maximum_animation_scale, | 540 float maximum_animation_scale, |
| 541 float starting_animation_scale); | 541 float starting_animation_scale); |
| 542 void ResetCachedData(); | 542 void ResetCachedData(); |
| 543 void UpdateCachedNumber(); | 543 void UpdateCachedNumber(); |
| 544 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale( | 544 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale( |
| 545 int transform_id, | 545 int transform_id, |
| 546 int effect_id) const; | 546 int effect_id) const; |
| 547 bool ComputeTransformToTarget(int transform_id, |
| 548 int effect_id, |
| 549 gfx::Transform* transform) const; |
| 547 | 550 |
| 548 private: | 551 private: |
| 549 gfx::Vector2dF inner_viewport_container_bounds_delta_; | 552 gfx::Vector2dF inner_viewport_container_bounds_delta_; |
| 550 gfx::Vector2dF outer_viewport_container_bounds_delta_; | 553 gfx::Vector2dF outer_viewport_container_bounds_delta_; |
| 551 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; | 554 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; |
| 552 | 555 |
| 553 PropertyTreesCachedData cached_data_; | 556 PropertyTreesCachedData cached_data_; |
| 554 }; | 557 }; |
| 555 | 558 |
| 556 } // namespace cc | 559 } // namespace cc |
| 557 | 560 |
| 558 #endif // CC_TREES_PROPERTY_TREE_H_ | 561 #endif // CC_TREES_PROPERTY_TREE_H_ |
| OLD | NEW |