Chromium Code Reviews| Index: cc/trees/property_tree.cc |
| diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc |
| index b1fd5e4e7ce0ca5eaa0044fca364f527a59b6b91..2e419ca18080f473f6ea815af4ed6cb3104a84f8 100644 |
| --- a/cc/trees/property_tree.cc |
| +++ b/cc/trees/property_tree.cc |
| @@ -68,18 +68,8 @@ bool TransformTree::ComputeTransform(int source_id, |
| if (source_id > dest_id && IsDescendant(source_id, dest_id)) |
|
ajuma
2015/04/09 15:27:24
This IsDescendant can be moved inside a DCHECK too
jaydasika
2015/04/09 15:38:31
Done.
|
| return CombineTransformsBetween(source_id, dest_id, transform); |
| - if (dest_id > source_id && IsDescendant(dest_id, source_id)) |
| - return CombineInversesBetween(source_id, dest_id, transform); |
| - |
| - int lca = LowestCommonAncestor(source_id, dest_id); |
| - |
| - bool no_singular_matrices_to_lca = |
| - CombineTransformsBetween(source_id, lca, transform); |
| - |
| - bool no_singular_matrices_from_lca = |
| - CombineInversesBetween(lca, dest_id, transform); |
| - |
| - return no_singular_matrices_to_lca && no_singular_matrices_from_lca; |
| + DCHECK(IsDescendant(dest_id, source_id)); |
| + return CombineInversesBetween(source_id, dest_id, transform); |
| } |
| bool TransformTree::Are2DAxisAligned(int source_id, int dest_id) const { |
| @@ -110,27 +100,6 @@ bool TransformTree::IsDescendant(int desc_id, int source_id) const { |
| return true; |
| } |
| -int TransformTree::LowestCommonAncestor(int a, int b) const { |
| - std::set<int> chain_a; |
| - std::set<int> chain_b; |
| - while (a || b) { |
| - if (a) { |
| - a = Node(a)->parent_id; |
| - if (a > -1 && chain_b.find(a) != chain_b.end()) |
| - return a; |
| - chain_a.insert(a); |
| - } |
| - if (b) { |
| - b = Node(b)->parent_id; |
| - if (b > -1 && chain_a.find(b) != chain_a.end()) |
| - return b; |
| - chain_b.insert(b); |
| - } |
| - } |
| - NOTREACHED(); |
| - return 0; |
| -} |
| - |
| bool TransformTree::CombineTransformsBetween(int source_id, |
| int dest_id, |
| gfx::Transform* transform) const { |