| 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 #ifndef CC_TREES_PROPERTY_TREE_H_ | 5 #ifndef CC_TREES_PROPERTY_TREE_H_ |
| 6 #define CC_TREES_PROPERTY_TREE_H_ | 6 #define CC_TREES_PROPERTY_TREE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // we'll just use the baked to_parent). These values will be ultimately stored | 40 // we'll just use the baked to_parent). These values will be ultimately stored |
| 41 // directly on the transform/scroll display list items when that's possible, | 41 // directly on the transform/scroll display list items when that's possible, |
| 42 // or potentially in a scroll tree. | 42 // or potentially in a scroll tree. |
| 43 // | 43 // |
| 44 // TODO(vollick): will be moved when accelerated effects are implemented. | 44 // TODO(vollick): will be moved when accelerated effects are implemented. |
| 45 gfx::Transform pre_local; | 45 gfx::Transform pre_local; |
| 46 gfx::Transform local; | 46 gfx::Transform local; |
| 47 gfx::Transform post_local; | 47 gfx::Transform post_local; |
| 48 | 48 |
| 49 gfx::Transform to_parent; | 49 gfx::Transform to_parent; |
| 50 gfx::Transform from_parent; | |
| 51 | 50 |
| 52 gfx::Transform to_target; | 51 gfx::Transform to_target; |
| 53 gfx::Transform from_target; | 52 gfx::Transform from_target; |
| 54 | 53 |
| 55 gfx::Transform to_screen; | 54 gfx::Transform to_screen; |
| 56 gfx::Transform from_screen; | 55 gfx::Transform from_screen; |
| 57 | 56 |
| 58 int target_id; | 57 int target_id; |
| 59 // This id is used for all content that draws into a render surface associated | 58 // This id is used for all content that draws into a render surface associated |
| 60 // with this transform node. | 59 // with this transform node. |
| 61 int content_target_id; | 60 int content_target_id; |
| 62 | 61 |
| 63 // TODO(vollick): will be moved when accelerated effects are implemented. | 62 // TODO(vollick): will be moved when accelerated effects are implemented. |
| 64 bool needs_local_transform_update; | 63 bool needs_local_transform_update; |
| 65 | 64 |
| 66 bool is_invertible; | 65 bool is_invertible; |
| 67 bool ancestors_are_invertible; | 66 bool ancestors_are_invertible; |
| 68 | 67 |
| 69 bool is_animated; | 68 bool is_animated; |
| 70 bool to_screen_is_animated; | 69 bool to_screen_is_animated; |
| 71 | 70 |
| 72 // We don't necessarily create a transform node to apply flattening. If we've | 71 // Flattening, when needed, is only applied to a node's inherited transform, |
| 73 // skipped flattening for an ancestor, we must flatten the transform we | 72 // never to its local transform. |
| 74 // inherit, but we don't necessarily need to flatten our local transform. We | |
| 75 // must therefore use two values to describe the flattening required for the | |
| 76 // local and inherited transforms. | |
| 77 bool flattens_inherited_transform; | 73 bool flattens_inherited_transform; |
| 78 bool flattens_local_transform; | 74 |
| 75 // This is true if the to_parent transform at every node on the path to the |
| 76 // root is flat. |
| 77 bool node_and_ancestors_are_flat; |
| 78 |
| 79 bool scrolls; | 79 bool scrolls; |
| 80 | 80 |
| 81 bool needs_sublayer_scale; | 81 bool needs_sublayer_scale; |
| 82 // This is used as a fallback when we either cannot adjust raster scale or if | 82 // This is used as a fallback when we either cannot adjust raster scale or if |
| 83 // the raster scale cannot be extracted from the screen space transform. | 83 // the raster scale cannot be extracted from the screen space transform. |
| 84 float layer_scale_factor; | 84 float layer_scale_factor; |
| 85 gfx::Vector2dF sublayer_scale; | 85 gfx::Vector2dF sublayer_scale; |
| 86 | 86 |
| 87 // TODO(vollick): will be moved when accelerated effects are implemented. | 87 // TODO(vollick): will be moved when accelerated effects are implemented. |
| 88 gfx::Vector2dF scroll_offset; | 88 gfx::Vector2dF scroll_offset; |
| 89 | 89 |
| 90 void set_to_parent(const gfx::Transform& transform) { | 90 void set_to_parent(const gfx::Transform& transform) { |
| 91 to_parent = transform; | 91 to_parent = transform; |
| 92 is_invertible = to_parent.GetInverse(&from_parent); | 92 is_invertible = to_parent.IsInvertible(); |
| 93 } | 93 } |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 typedef TreeNode<TransformNodeData> TransformNode; | 96 typedef TreeNode<TransformNodeData> TransformNode; |
| 97 | 97 |
| 98 struct CC_EXPORT ClipNodeData { | 98 struct CC_EXPORT ClipNodeData { |
| 99 ClipNodeData(); | 99 ClipNodeData(); |
| 100 | 100 |
| 101 gfx::RectF clip; | 101 gfx::RectF clip; |
| 102 gfx::RectF combined_clip; | 102 gfx::RectF combined_clip; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 void UpdateSnapping(TransformNode* node); | 188 void UpdateSnapping(TransformNode* node); |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 class CC_EXPORT ClipTree final : public PropertyTree<ClipNode> {}; | 191 class CC_EXPORT ClipTree final : public PropertyTree<ClipNode> {}; |
| 192 | 192 |
| 193 class CC_EXPORT OpacityTree final : public PropertyTree<OpacityNode> {}; | 193 class CC_EXPORT OpacityTree final : public PropertyTree<OpacityNode> {}; |
| 194 | 194 |
| 195 } // namespace cc | 195 } // namespace cc |
| 196 | 196 |
| 197 #endif // CC_TREES_PROPERTY_TREE_H_ | 197 #endif // CC_TREES_PROPERTY_TREE_H_ |
| OLD | NEW |