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

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

Issue 1070133002: Only allow change-of-basis between transform nodes on the same ancestor chain (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2nd DCHECK added Created 5 years, 8 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
« no previous file with comments | « no previous file | 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 <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 bool Are2DAxisAligned(int source_id, int dest_id) const; 158 bool Are2DAxisAligned(int source_id, int dest_id) const;
159 159
160 // Updates the parent, target, and screen space transforms and snapping. 160 // Updates the parent, target, and screen space transforms and snapping.
161 void UpdateTransforms(int id); 161 void UpdateTransforms(int id);
162 162
163 private: 163 private:
164 // Returns true iff the node at |desc_id| is a descendant of the node at 164 // Returns true iff the node at |desc_id| is a descendant of the node at
165 // |anc_id|. 165 // |anc_id|.
166 bool IsDescendant(int desc_id, int anc_id) const; 166 bool IsDescendant(int desc_id, int anc_id) const;
167 167
168 // Returns the index of the lowest common ancestor of the nodes |a| and |b|.
169 int LowestCommonAncestor(int a, int b) const;
170
171 // Computes the combined transform between |source_id| and |dest_id| and 168 // Computes the combined transform between |source_id| and |dest_id| and
172 // returns false if the inverse of a singular transform was used. These two 169 // returns false if the inverse of a singular transform was used. These two
173 // nodes must be on the same ancestor chain. 170 // nodes must be on the same ancestor chain.
174 bool CombineTransformsBetween(int source_id, 171 bool CombineTransformsBetween(int source_id,
175 int dest_id, 172 int dest_id,
176 gfx::Transform* transform) const; 173 gfx::Transform* transform) const;
177 174
178 // Computes the combined inverse transform between |source_id| and |dest_id| 175 // Computes the combined inverse transform between |source_id| and |dest_id|
179 // and returns false if the inverse of a singular transform was used. These 176 // and returns false if the inverse of a singular transform was used. These
180 // two nodes must be on the same ancestor chain. 177 // two nodes must be on the same ancestor chain.
(...skipping 12 matching lines...) Expand all
193 void UpdateSnapping(TransformNode* node); 190 void UpdateSnapping(TransformNode* node);
194 }; 191 };
195 192
196 class CC_EXPORT ClipTree final : public PropertyTree<ClipNode> {}; 193 class CC_EXPORT ClipTree final : public PropertyTree<ClipNode> {};
197 194
198 class CC_EXPORT OpacityTree final : public PropertyTree<OpacityNode> {}; 195 class CC_EXPORT OpacityTree final : public PropertyTree<OpacityNode> {};
199 196
200 } // namespace cc 197 } // namespace cc
201 198
202 #endif // CC_TREES_PROPERTY_TREE_H_ 199 #endif // CC_TREES_PROPERTY_TREE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698