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

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

Issue 2164833002: Use surface contents scale from effect tree (3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 5 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 const TransformNode* dest_node = Node(dest_id); 166 const TransformNode* dest_node = Node(dest_id);
167 if (!dest_node->needs_surface_contents_scale) 167 if (!dest_node->needs_surface_contents_scale)
168 return success; 168 return success;
169 169
170 transform->matrix().postScale(dest_node->surface_contents_scale.x(), 170 transform->matrix().postScale(dest_node->surface_contents_scale.x(),
171 dest_node->surface_contents_scale.y(), 1.f); 171 dest_node->surface_contents_scale.y(), 1.f);
172 return success; 172 return success;
173 } 173 }
174 174
175 bool TransformTree::Are2DAxisAligned(int source_id, int dest_id) const {
176 gfx::Transform transform;
177 return ComputeTransform(source_id, dest_id, &transform) &&
178 transform.Preserves2dAxisAlignment();
179 }
180
181 bool TransformTree::NeedsSourceToParentUpdate(TransformNode* node) { 175 bool TransformTree::NeedsSourceToParentUpdate(TransformNode* node) {
182 return (source_to_parent_updates_allowed() && 176 return (source_to_parent_updates_allowed() &&
183 node->parent_id != node->source_node_id); 177 node->parent_id != node->source_node_id);
184 } 178 }
185 179
186 void TransformTree::ResetChangeTracking() { 180 void TransformTree::ResetChangeTracking() {
187 for (int id = 1; id < static_cast<int>(size()); ++id) { 181 for (int id = 1; id < static_cast<int>(size()); ++id) {
188 TransformNode* node = Node(id); 182 TransformNode* node = Node(id);
189 node->transform_changed = false; 183 node->transform_changed = false;
190 } 184 }
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 cached_data_.property_tree_update_number = 0; 1875 cached_data_.property_tree_update_number = 0;
1882 cached_data_.animation_scales = std::vector<AnimationScaleData>( 1876 cached_data_.animation_scales = std::vector<AnimationScaleData>(
1883 transform_tree.nodes().size(), AnimationScaleData()); 1877 transform_tree.nodes().size(), AnimationScaleData());
1884 } 1878 }
1885 1879
1886 void PropertyTrees::UpdateCachedNumber() { 1880 void PropertyTrees::UpdateCachedNumber() {
1887 cached_data_.property_tree_update_number++; 1881 cached_data_.property_tree_update_number++;
1888 } 1882 }
1889 1883
1890 } // namespace cc 1884 } // 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