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

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

Issue 2712053002: cc : Fix transform calculation bug while calculating clip rects (Closed)
Patch Set: clean_up Created 3 years, 10 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 | « cc/trees/property_tree.h ('k') | no next file » | 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 #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
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
OLDNEW
« no previous file with comments | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698