| 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 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 gfx::Transform to_screen = ToScreen(dest_id); | 206 gfx::Transform to_screen = ToScreen(dest_id); |
| 207 to_screen.FlattenTo2d(); | 207 to_screen.FlattenTo2d(); |
| 208 gfx::Transform from_screen; | 208 gfx::Transform from_screen; |
| 209 bool success = to_screen.GetInverse(&from_screen); | 209 bool success = to_screen.GetInverse(&from_screen); |
| 210 if (!success) | 210 if (!success) |
| 211 return false; | 211 return false; |
| 212 transform->ConcatTransform(from_screen); | 212 transform->ConcatTransform(from_screen); |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 | 215 |
| 216 DCHECK( | |
| 217 transform->IsApproximatelyIdentityOrTranslation(SkDoubleToMScalar(1e-4))); | |
| 218 return true; | 216 return true; |
| 219 } | 217 } |
| 220 | 218 |
| 221 bool TransformTree::NeedsSourceToParentUpdate(TransformNode* node) { | 219 bool TransformTree::NeedsSourceToParentUpdate(TransformNode* node) { |
| 222 return (source_to_parent_updates_allowed() && | 220 return (source_to_parent_updates_allowed() && |
| 223 node->parent_id != node->source_node_id); | 221 node->parent_id != node->source_node_id); |
| 224 } | 222 } |
| 225 | 223 |
| 226 void TransformTree::ResetChangeTracking() { | 224 void TransformTree::ResetChangeTracking() { |
| 227 for (int id = 1; id < static_cast<int>(size()); ++id) { | 225 for (int id = 1; id < static_cast<int>(size()); ++id) { |
| (...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2203 from_target.ConcatTransform(draw_transforms.from_target); | 2201 from_target.ConcatTransform(draw_transforms.from_target); |
| 2204 from_target.Scale(effect_node->surface_contents_scale.x(), | 2202 from_target.Scale(effect_node->surface_contents_scale.x(), |
| 2205 effect_node->surface_contents_scale.y()); | 2203 effect_node->surface_contents_scale.y()); |
| 2206 DCHECK(from_target.ApproximatelyEqual(*transform) || | 2204 DCHECK(from_target.ApproximatelyEqual(*transform) || |
| 2207 !draw_transforms.invertible); | 2205 !draw_transforms.invertible); |
| 2208 } | 2206 } |
| 2209 return success; | 2207 return success; |
| 2210 } | 2208 } |
| 2211 | 2209 |
| 2212 } // namespace cc | 2210 } // namespace cc |
| OLD | NEW |