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

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

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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') | cc/trees/property_tree_builder.cc » ('j') | 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 <set> 5 #include <set>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/trees/property_tree.h" 9 #include "cc/trees/property_tree.h"
10 10
(...skipping 25 matching lines...) Expand all
36 template class PropertyTree<OpacityNode>; 36 template class PropertyTree<OpacityNode>;
37 37
38 TransformNodeData::TransformNodeData() 38 TransformNodeData::TransformNodeData()
39 : target_id(-1), 39 : target_id(-1),
40 content_target_id(-1), 40 content_target_id(-1),
41 needs_local_transform_update(true), 41 needs_local_transform_update(true),
42 is_invertible(true), 42 is_invertible(true),
43 ancestors_are_invertible(true), 43 ancestors_are_invertible(true),
44 is_animated(false), 44 is_animated(false),
45 to_screen_is_animated(false), 45 to_screen_is_animated(false),
46 flattens(false), 46 flattens_inherited_transform(false),
47 flattens_local_transform(false),
47 scrolls(false), 48 scrolls(false),
48 needs_sublayer_scale(false), 49 needs_sublayer_scale(false),
49 layer_scale_factor(1.0f) { 50 layer_scale_factor(1.0f) {
50 } 51 }
51 52
52 TransformNodeData::~TransformNodeData() { 53 TransformNodeData::~TransformNodeData() {
53 } 54 }
54 55
55 ClipNodeData::ClipNodeData() : transform_id(-1), target_id(-1) { 56 ClipNodeData::ClipNodeData() : transform_id(-1), target_id(-1) {
56 } 57 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 node->data.needs_local_transform_update = false; 184 node->data.needs_local_transform_update = false;
184 } 185 }
185 186
186 void TransformTree::UpdateScreenSpaceTransform(TransformNode* node, 187 void TransformTree::UpdateScreenSpaceTransform(TransformNode* node,
187 TransformNode* parent_node, 188 TransformNode* parent_node,
188 TransformNode* target_node) { 189 TransformNode* target_node) {
189 if (!parent_node) { 190 if (!parent_node) {
190 node->data.to_screen = node->data.to_parent; 191 node->data.to_screen = node->data.to_parent;
191 node->data.ancestors_are_invertible = true; 192 node->data.ancestors_are_invertible = true;
192 node->data.to_screen_is_animated = false; 193 node->data.to_screen_is_animated = false;
193 } else if (parent_node->data.flattens) { 194 } else if (parent_node->data.flattens_local_transform ||
195 node->data.flattens_inherited_transform) {
194 // Flattening is tricky. Once a layer is drawn into its render target, it 196 // Flattening is tricky. Once a layer is drawn into its render target, it
195 // cannot escape, so we only need to consider transforms between the layer 197 // cannot escape, so we only need to consider transforms between the layer
196 // and its target when flattening (i.e., its draw transform). To compute the 198 // and its target when flattening (i.e., its draw transform). To compute the
197 // screen space transform when flattening is involved we combine three 199 // screen space transform when flattening is involved we combine three
198 // transforms, A * B * C, where A is the screen space transform of the 200 // transforms, A * B * C, where A is the screen space transform of the
199 // target, B is the flattened draw transform of the layer's parent, and C is 201 // target, B is the flattened draw transform of the layer's parent, and C is
200 // the local transform. 202 // the local transform.
201 node->data.to_screen = target_node->data.to_screen; 203 node->data.to_screen = target_node->data.to_screen;
202 gfx::Transform flattened; 204 gfx::Transform flattened;
203 ComputeTransform(parent_node->id, target_node->id, &flattened); 205 ComputeTransform(parent_node->id, target_node->id, &flattened);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // combined, to/from matrices. 288 // combined, to/from matrices.
287 node->data.to_parent.PreconcatTransform(delta); 289 node->data.to_parent.PreconcatTransform(delta);
288 node->data.from_parent.ConcatTransform(inverse_delta); 290 node->data.from_parent.ConcatTransform(inverse_delta);
289 node->data.to_target.PreconcatTransform(delta); 291 node->data.to_target.PreconcatTransform(delta);
290 node->data.from_target.ConcatTransform(inverse_delta); 292 node->data.from_target.ConcatTransform(inverse_delta);
291 node->data.to_screen.PreconcatTransform(delta); 293 node->data.to_screen.PreconcatTransform(delta);
292 node->data.from_screen.ConcatTransform(inverse_delta); 294 node->data.from_screen.ConcatTransform(inverse_delta);
293 } 295 }
294 296
295 } // namespace cc 297 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/property_tree.h ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698