Chromium Code Reviews| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 // be computed between any pair of nodes that have an ancestor/descendant | 147 // be computed between any pair of nodes that have an ancestor/descendant |
| 148 // relationship. Transforms between other pairs of nodes may only be computed | 148 // relationship. Transforms between other pairs of nodes may only be computed |
| 149 // if the following condition holds: let id1 the larger id and let id2 be the | 149 // if the following condition holds: let id1 the larger id and let id2 be the |
| 150 // other id; then the nearest ancestor of node id1 whose id is smaller than | 150 // other id; then the nearest ancestor of node id1 whose id is smaller than |
| 151 // id2 is the lowest common ancestor of the pair of nodes, and the transform | 151 // id2 is the lowest common ancestor of the pair of nodes, and the transform |
| 152 // from this lowest common ancestor to node id2 is only a 2d translation. | 152 // from this lowest common ancestor to node id2 is only a 2d translation. |
| 153 bool ComputeTransform(int source_id, | 153 bool ComputeTransform(int source_id, |
| 154 int dest_id, | 154 int dest_id, |
| 155 gfx::Transform* transform) const; | 155 gfx::Transform* transform) const; |
| 156 | 156 |
| 157 bool ComputeTransformFromSourceToParent(int source_id, | |
| 158 int dest_id, | |
| 159 gfx::Transform* transform) const; | |
|
ajuma
2016/07/27 15:57:11
It'd be good if there was some way to enforce that
jaydasika
2016/07/27 18:42:23
Done.
| |
| 160 | |
| 157 void ResetChangeTracking(); | 161 void ResetChangeTracking(); |
| 158 // Updates the parent, target, and screen space transforms and snapping. | 162 // Updates the parent, target, and screen space transforms and snapping. |
| 159 void UpdateTransforms(int id); | 163 void UpdateTransforms(int id); |
| 160 void UpdateTransformChanged(TransformNode* node, | 164 void UpdateTransformChanged(TransformNode* node, |
| 161 TransformNode* parent_node, | 165 TransformNode* parent_node, |
| 162 TransformNode* source_node); | 166 TransformNode* source_node); |
| 163 void UpdateNodeAndAncestorsAreAnimatedOrInvertible( | 167 void UpdateNodeAndAncestorsAreAnimatedOrInvertible( |
| 164 TransformNode* node, | 168 TransformNode* node, |
| 165 TransformNode* parent_node); | 169 TransformNode* parent_node); |
| 166 | 170 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 void SetContentTargetId(int node_id, int content_target_id); | 242 void SetContentTargetId(int node_id, int content_target_id); |
| 239 | 243 |
| 240 const std::vector<TransformCachedNodeData>& cached_data() const { | 244 const std::vector<TransformCachedNodeData>& cached_data() const { |
| 241 return cached_data_; | 245 return cached_data_; |
| 242 } | 246 } |
| 243 | 247 |
| 244 void ToProtobuf(proto::PropertyTree* proto) const; | 248 void ToProtobuf(proto::PropertyTree* proto) const; |
| 245 void FromProtobuf(const proto::PropertyTree& proto, | 249 void FromProtobuf(const proto::PropertyTree& proto, |
| 246 std::unordered_map<int, int>* node_id_to_index_map); | 250 std::unordered_map<int, int>* node_id_to_index_map); |
| 247 | 251 |
| 248 // Computes the combined transform between |source_id| and |dest_id| and | 252 // Computes the combined transform between |source_id| and |dest_id|. These |
| 249 // returns false if the inverse of a singular transform was used. These two | 253 // two nodes must be on the same ancestor chain. |
| 250 // nodes must be on the same ancestor chain. | 254 void CombineTransformsBetween(int source_id, |
| 251 bool CombineTransformsBetween(int source_id, | |
| 252 int dest_id, | 255 int dest_id, |
| 253 gfx::Transform* transform) const; | 256 gfx::Transform* transform) const; |
| 254 | 257 |
| 255 // Computes the combined inverse transform between |source_id| and |dest_id| | 258 // Computes the combined inverse transform between |source_id| and |dest_id| |
| 256 // and returns false if the inverse of a singular transform was used. These | 259 // and returns false if the inverse of a singular transform was used. These |
| 257 // two nodes must be on the same ancestor chain. | 260 // two nodes must be on the same ancestor chain. |
| 258 bool CombineInversesBetween(int source_id, | 261 bool CombineInversesBetween(int source_id, |
| 259 int dest_id, | 262 int dest_id, |
| 260 gfx::Transform* transform) const; | 263 gfx::Transform* transform) const; |
| 261 | 264 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 | 587 |
| 585 void ResetCachedData(); | 588 void ResetCachedData(); |
| 586 void UpdateCachedNumber(); | 589 void UpdateCachedNumber(); |
| 587 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale( | 590 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale( |
| 588 int transform_id, | 591 int transform_id, |
| 589 int effect_id) const; | 592 int effect_id) const; |
| 590 bool ComputeTransformToTarget(int transform_id, | 593 bool ComputeTransformToTarget(int transform_id, |
| 591 int effect_id, | 594 int effect_id, |
| 592 gfx::Transform* transform) const; | 595 gfx::Transform* transform) const; |
| 593 | 596 |
| 597 bool ComputeTransformFromTarget(int transform_id, | |
| 598 int effect_id, | |
| 599 gfx::Transform* transform) const; | |
| 600 | |
| 594 private: | 601 private: |
| 595 gfx::Vector2dF inner_viewport_container_bounds_delta_; | 602 gfx::Vector2dF inner_viewport_container_bounds_delta_; |
| 596 gfx::Vector2dF outer_viewport_container_bounds_delta_; | 603 gfx::Vector2dF outer_viewport_container_bounds_delta_; |
| 597 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; | 604 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; |
| 598 | 605 |
| 599 PropertyTreesCachedData cached_data_; | 606 PropertyTreesCachedData cached_data_; |
| 600 }; | 607 }; |
| 601 | 608 |
| 602 } // namespace cc | 609 } // namespace cc |
| 603 | 610 |
| 604 #endif // CC_TREES_PROPERTY_TREE_H_ | 611 #endif // CC_TREES_PROPERTY_TREE_H_ |
| OLD | NEW |