| 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 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 gfx::Transform screen_space_transform = transform_tree.ToScreen(transform_id); | 2113 gfx::Transform screen_space_transform = transform_tree.ToScreen(transform_id); |
| 2114 const EffectNode* effect_node = effect_tree.Node(effect_id); | 2114 const EffectNode* effect_node = effect_tree.Node(effect_id); |
| 2115 | 2115 |
| 2116 if (effect_node->surface_contents_scale.x() != 0.0 && | 2116 if (effect_node->surface_contents_scale.x() != 0.0 && |
| 2117 effect_node->surface_contents_scale.y() != 0.0) | 2117 effect_node->surface_contents_scale.y() != 0.0) |
| 2118 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), | 2118 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), |
| 2119 1.0 / effect_node->surface_contents_scale.y()); | 2119 1.0 / effect_node->surface_contents_scale.y()); |
| 2120 return screen_space_transform; | 2120 return screen_space_transform; |
| 2121 } | 2121 } |
| 2122 | 2122 |
| 2123 bool PropertyTrees::ComputeTransformFromTarget( | |
| 2124 int transform_id, | |
| 2125 int effect_id, | |
| 2126 gfx::Transform* transform) const { | |
| 2127 transform->MakeIdentity(); | |
| 2128 if (transform_id == TransformTree::kInvalidNodeId) | |
| 2129 return true; | |
| 2130 | |
| 2131 const EffectNode* effect_node = effect_tree.Node(effect_id); | |
| 2132 | |
| 2133 bool success = GetFromTarget(transform_id, effect_id, transform); | |
| 2134 transform->Scale(effect_node->surface_contents_scale.x(), | |
| 2135 effect_node->surface_contents_scale.y()); | |
| 2136 return success; | |
| 2137 } | |
| 2138 | |
| 2139 } // namespace cc | 2123 } // namespace cc |
| OLD | NEW |