Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: cc/trees/property_tree.h

Issue 2180223005: cc : Split TransformTree::ComputeTransform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Computes the change of basis transform from node |source_id| to |dest_id|.
158 // This is used by scroll children to compute transform from their scroll
159 // parent space (source) to their parent space (destination) and it can atmost
160 // be a translation.
161 bool ComputeTranslation(int source_id,
162 int dest_id,
163 gfx::Transform* transform) const;
164
157 void ResetChangeTracking(); 165 void ResetChangeTracking();
158 // Updates the parent, target, and screen space transforms and snapping. 166 // Updates the parent, target, and screen space transforms and snapping.
159 void UpdateTransforms(int id); 167 void UpdateTransforms(int id);
160 void UpdateTransformChanged(TransformNode* node, 168 void UpdateTransformChanged(TransformNode* node,
161 TransformNode* parent_node, 169 TransformNode* parent_node,
162 TransformNode* source_node); 170 TransformNode* source_node);
163 void UpdateNodeAndAncestorsAreAnimatedOrInvertible( 171 void UpdateNodeAndAncestorsAreAnimatedOrInvertible(
164 TransformNode* node, 172 TransformNode* node,
165 TransformNode* parent_node); 173 TransformNode* parent_node);
166 174
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 void SetContentTargetId(int node_id, int content_target_id); 246 void SetContentTargetId(int node_id, int content_target_id);
239 247
240 const std::vector<TransformCachedNodeData>& cached_data() const { 248 const std::vector<TransformCachedNodeData>& cached_data() const {
241 return cached_data_; 249 return cached_data_;
242 } 250 }
243 251
244 void ToProtobuf(proto::PropertyTree* proto) const; 252 void ToProtobuf(proto::PropertyTree* proto) const;
245 void FromProtobuf(const proto::PropertyTree& proto, 253 void FromProtobuf(const proto::PropertyTree& proto,
246 std::unordered_map<int, int>* node_id_to_index_map); 254 std::unordered_map<int, int>* node_id_to_index_map);
247 255
248 // Computes the combined transform between |source_id| and |dest_id| and 256 // 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 257 // two nodes must be on the same ancestor chain.
250 // nodes must be on the same ancestor chain. 258 void CombineTransformsBetween(int source_id,
251 bool CombineTransformsBetween(int source_id,
252 int dest_id, 259 int dest_id,
253 gfx::Transform* transform) const; 260 gfx::Transform* transform) const;
254 261
255 // Computes the combined inverse transform between |source_id| and |dest_id| 262 // 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 263 // and returns false if the inverse of a singular transform was used. These
257 // two nodes must be on the same ancestor chain. 264 // two nodes must be on the same ancestor chain.
258 bool CombineInversesBetween(int source_id, 265 bool CombineInversesBetween(int source_id,
259 int dest_id, 266 int dest_id,
260 gfx::Transform* transform) const; 267 gfx::Transform* transform) const;
261 268
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 591
585 void ResetCachedData(); 592 void ResetCachedData();
586 void UpdateCachedNumber(); 593 void UpdateCachedNumber();
587 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale( 594 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale(
588 int transform_id, 595 int transform_id,
589 int effect_id) const; 596 int effect_id) const;
590 bool ComputeTransformToTarget(int transform_id, 597 bool ComputeTransformToTarget(int transform_id,
591 int effect_id, 598 int effect_id,
592 gfx::Transform* transform) const; 599 gfx::Transform* transform) const;
593 600
601 bool ComputeTransformFromTarget(int transform_id,
602 int effect_id,
603 gfx::Transform* transform) const;
604
594 private: 605 private:
595 gfx::Vector2dF inner_viewport_container_bounds_delta_; 606 gfx::Vector2dF inner_viewport_container_bounds_delta_;
596 gfx::Vector2dF outer_viewport_container_bounds_delta_; 607 gfx::Vector2dF outer_viewport_container_bounds_delta_;
597 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; 608 gfx::Vector2dF inner_viewport_scroll_bounds_delta_;
598 609
599 PropertyTreesCachedData cached_data_; 610 PropertyTreesCachedData cached_data_;
600 }; 611 };
601 612
602 } // namespace cc 613 } // namespace cc
603 614
604 #endif // CC_TREES_PROPERTY_TREE_H_ 615 #endif // CC_TREES_PROPERTY_TREE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698