| 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 2069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2080 gfx::Transform screen_space_transform = transform_tree.ToScreen(transform_id); | 2080 gfx::Transform screen_space_transform = transform_tree.ToScreen(transform_id); |
| 2081 const EffectNode* effect_node = effect_tree.Node(effect_id); | 2081 const EffectNode* effect_node = effect_tree.Node(effect_id); |
| 2082 | 2082 |
| 2083 if (effect_node->surface_contents_scale.x() != 0.0 && | 2083 if (effect_node->surface_contents_scale.x() != 0.0 && |
| 2084 effect_node->surface_contents_scale.y() != 0.0) | 2084 effect_node->surface_contents_scale.y() != 0.0) |
| 2085 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), | 2085 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), |
| 2086 1.0 / effect_node->surface_contents_scale.y()); | 2086 1.0 / effect_node->surface_contents_scale.y()); |
| 2087 return screen_space_transform; | 2087 return screen_space_transform; |
| 2088 } | 2088 } |
| 2089 | 2089 |
| 2090 bool PropertyTrees::ComputeTransformFromTarget( | |
| 2091 int transform_id, | |
| 2092 int effect_id, | |
| 2093 gfx::Transform* transform) const { | |
| 2094 transform->MakeIdentity(); | |
| 2095 if (transform_id == TransformTree::kInvalidNodeId) | |
| 2096 return true; | |
| 2097 | |
| 2098 const EffectNode* effect_node = effect_tree.Node(effect_id); | |
| 2099 | |
| 2100 bool success = GetFromTarget(transform_id, effect_id, transform); | |
| 2101 transform->Scale(effect_node->surface_contents_scale.x(), | |
| 2102 effect_node->surface_contents_scale.y()); | |
| 2103 return success; | |
| 2104 } | |
| 2105 | |
| 2106 } // namespace cc | 2090 } // namespace cc |
| OLD | NEW |