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

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

Issue 2448403002: cc: Clean up transform tree (Closed)
Patch Set: PAC Created 4 years, 1 month 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
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 // Computes the change of basis transform from node |source_id| to |dest_id|. 162 // Computes the change of basis transform from node |source_id| to |dest_id|.
163 // The function returns false iff the inverse of a singular transform was 163 // The function returns false iff the inverse of a singular transform was
164 // used (and the result should, therefore, not be trusted). Transforms may 164 // used (and the result should, therefore, not be trusted). Transforms may
165 // be computed between any pair of nodes that have an ancestor/descendant 165 // be computed between any pair of nodes that have an ancestor/descendant
166 // relationship. Transforms between other pairs of nodes may only be computed 166 // relationship. Transforms between other pairs of nodes may only be computed
167 // if the following condition holds: let id1 the larger id and let id2 be the 167 // if the following condition holds: let id1 the larger id and let id2 be the
168 // other id; then the nearest ancestor of node id1 whose id is smaller than 168 // other id; then the nearest ancestor of node id1 whose id is smaller than
169 // id2 is the lowest common ancestor of the pair of nodes, and the transform 169 // id2 is the lowest common ancestor of the pair of nodes, and the transform
170 // from this lowest common ancestor to node id2 is only a 2d translation. 170 // from this lowest common ancestor to node id2 is only a 2d translation.
171 bool ComputeTransform(int source_id, 171 bool ComputeTransformForTesting(int source_id,
172 int dest_id, 172 int dest_id,
173 gfx::Transform* transform) const; 173 gfx::Transform* transform) const;
174 174
175 void OnTransformAnimated(const gfx::Transform& transform, 175 void OnTransformAnimated(const gfx::Transform& transform,
176 int id, 176 int id,
177 LayerTreeImpl* layer_tree_impl); 177 LayerTreeImpl* layer_tree_impl);
178 // Computes the change of basis transform from node |source_id| to |dest_id|. 178 // Computes the change of basis transform from node |source_id| to |dest_id|.
179 // This is used by scroll children to compute transform from their scroll 179 // This is used by scroll children to compute transform from their scroll
180 // parent space (source) to their parent space (destination) and it can atmost 180 // parent space (source) to their parent space (destination) and it can atmost
181 // be a translation. This function assumes that the path from source to 181 // be a translation. This function assumes that the path from source to
182 // destination has only translations. So, it should not be called when there 182 // destination has only translations. So, it should not be called when there
183 // can be intermediate 3d transforms but the end result is a translation. 183 // can be intermediate 3d transforms but the end result is a translation.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 const std::vector<int>& nodes_affected_by_inner_viewport_bounds_delta() 246 const std::vector<int>& nodes_affected_by_inner_viewport_bounds_delta()
247 const { 247 const {
248 return nodes_affected_by_inner_viewport_bounds_delta_; 248 return nodes_affected_by_inner_viewport_bounds_delta_;
249 } 249 }
250 const std::vector<int>& nodes_affected_by_outer_viewport_bounds_delta() 250 const std::vector<int>& nodes_affected_by_outer_viewport_bounds_delta()
251 const { 251 const {
252 return nodes_affected_by_outer_viewport_bounds_delta_; 252 return nodes_affected_by_outer_viewport_bounds_delta_;
253 } 253 }
254 254
255 gfx::Transform FromTarget(int node_id, int effect) const;
256 void SetFromTarget(int node_id, const gfx::Transform& transform);
257
258 // TODO(sunxd): Remove target space transforms in cached data when we
259 // completely implement computing draw transforms on demand.
260 gfx::Transform ToTarget(int node_id, int effect_id) const;
261 void SetToTarget(int node_id, const gfx::Transform& transform);
262
263 const gfx::Transform& FromScreen(int node_id) const; 255 const gfx::Transform& FromScreen(int node_id) const;
264 void SetFromScreen(int node_id, const gfx::Transform& transform); 256 void SetFromScreen(int node_id, const gfx::Transform& transform);
265 257
266 const gfx::Transform& ToScreen(int node_id) const; 258 const gfx::Transform& ToScreen(int node_id) const;
267 void SetToScreen(int node_id, const gfx::Transform& transform); 259 void SetToScreen(int node_id, const gfx::Transform& transform);
268 260
269 int TargetId(int node_id) const; 261 int TargetId(int node_id) const;
270 void SetTargetId(int node_id, int target_id); 262 void SetTargetId(int node_id, int target_id);
271 263
272 int ContentTargetId(int node_id) const; 264 int ContentTargetId(int node_id) const;
(...skipping 24 matching lines...) Expand all
297 289
298 private: 290 private:
299 // Returns true iff the node at |desc_id| is a descendant of the node at 291 // Returns true iff the node at |desc_id| is a descendant of the node at
300 // |anc_id|. 292 // |anc_id|.
301 bool IsDescendant(int desc_id, int anc_id) const; 293 bool IsDescendant(int desc_id, int anc_id) const;
302 294
303 void UpdateLocalTransform(TransformNode* node); 295 void UpdateLocalTransform(TransformNode* node);
304 void UpdateScreenSpaceTransform(TransformNode* node, 296 void UpdateScreenSpaceTransform(TransformNode* node,
305 TransformNode* parent_node, 297 TransformNode* parent_node,
306 TransformNode* target_node); 298 TransformNode* target_node);
307 void UpdateSurfaceContentsScale(TransformNode* node);
308 void UpdateTargetSpaceTransform(TransformNode* node,
309 TransformNode* target_node);
310 void UpdateAnimationProperties(TransformNode* node, 299 void UpdateAnimationProperties(TransformNode* node,
311 TransformNode* parent_node); 300 TransformNode* parent_node);
312 void UndoSnapping(TransformNode* node); 301 void UndoSnapping(TransformNode* node);
313 void UpdateSnapping(TransformNode* node); 302 void UpdateSnapping(TransformNode* node);
314 void UpdateNodeAndAncestorsHaveIntegerTranslations( 303 void UpdateNodeAndAncestorsHaveIntegerTranslations(
315 TransformNode* node, 304 TransformNode* node,
316 TransformNode* parent_node); 305 TransformNode* parent_node);
317 bool NeedsSourceToParentUpdate(TransformNode* node); 306 bool NeedsSourceToParentUpdate(TransformNode* node);
318 void SetContentsRootPostLocalTransform(const gfx::Transform& transform, 307 void SetContentsRootPostLocalTransform(const gfx::Transform& transform,
319 gfx::PointF root_position); 308 gfx::PointF root_position);
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 gfx::Transform* to_target) const; 639 gfx::Transform* to_target) const;
651 bool GetFromTarget(int transform_id, 640 bool GetFromTarget(int transform_id,
652 int effect_id, 641 int effect_id,
653 gfx::Transform* from_target) const; 642 gfx::Transform* from_target) const;
654 643
655 void ResetCachedData(); 644 void ResetCachedData();
656 void UpdateCachedNumber(); 645 void UpdateCachedNumber();
657 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale( 646 gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale(
658 int transform_id, 647 int transform_id,
659 int effect_id) const; 648 int effect_id) const;
660 bool ComputeTransformToTarget(int transform_id,
661 int effect_id,
662 gfx::Transform* transform) const;
663 649
664 bool ComputeTransformFromTarget(int transform_id, 650 bool ComputeTransformFromTarget(int transform_id,
665 int effect_id, 651 int effect_id,
666 gfx::Transform* transform) const; 652 gfx::Transform* transform) const;
667 653
668 private: 654 private:
669 gfx::Vector2dF inner_viewport_container_bounds_delta_; 655 gfx::Vector2dF inner_viewport_container_bounds_delta_;
670 gfx::Vector2dF outer_viewport_container_bounds_delta_; 656 gfx::Vector2dF outer_viewport_container_bounds_delta_;
671 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; 657 gfx::Vector2dF inner_viewport_scroll_bounds_delta_;
672 658
673 // GetDrawTransforms may change the value of cached_data_. 659 // GetDrawTransforms may change the value of cached_data_.
674 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; 660 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const;
675 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, 661 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id,
676 int effect_id) const; 662 int effect_id) const;
677 663
678 PropertyTreesCachedData cached_data_; 664 PropertyTreesCachedData cached_data_;
679 }; 665 };
680 666
681 } // namespace cc 667 } // namespace cc
682 668
683 #endif // CC_TREES_PROPERTY_TREE_H_ 669 #endif // CC_TREES_PROPERTY_TREE_H_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698