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

Side by Side Diff: cc/trees/transform_node.h

Issue 2448403002: cc: Clean up transform tree (Closed)
Patch Set: PAC Created 4 years, 1 month 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_unittest.cc ('k') | cc/trees/transform_node.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_TRANSFORM_NODE_H_ 5 #ifndef CC_TREES_TRANSFORM_NODE_H_
6 #define CC_TREES_TRANSFORM_NODE_H_ 6 #define CC_TREES_TRANSFORM_NODE_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "ui/gfx/geometry/point_f.h" 9 #include "ui/gfx/geometry/point_f.h"
10 #include "ui/gfx/geometry/scroll_offset.h" 10 #include "ui/gfx/geometry/scroll_offset.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 // This is true if the to_parent transform at every node on the path to the 88 // This is true if the to_parent transform at every node on the path to the
89 // root is flat. 89 // root is flat.
90 bool node_and_ancestors_are_flat : 1; 90 bool node_and_ancestors_are_flat : 1;
91 91
92 // This is needed to know if a layer can use lcd text. 92 // This is needed to know if a layer can use lcd text.
93 bool node_and_ancestors_have_only_integer_translation : 1; 93 bool node_and_ancestors_have_only_integer_translation : 1;
94 94
95 bool scrolls : 1; 95 bool scrolls : 1;
96 96
97 bool needs_surface_contents_scale : 1;
98
99 // These are used to position nodes wrt the right or bottom of the inner or 97 // These are used to position nodes wrt the right or bottom of the inner or
100 // outer viewport. 98 // outer viewport.
101 bool affected_by_inner_viewport_bounds_delta_x : 1; 99 bool affected_by_inner_viewport_bounds_delta_x : 1;
102 bool affected_by_inner_viewport_bounds_delta_y : 1; 100 bool affected_by_inner_viewport_bounds_delta_y : 1;
103 bool affected_by_outer_viewport_bounds_delta_x : 1; 101 bool affected_by_outer_viewport_bounds_delta_x : 1;
104 bool affected_by_outer_viewport_bounds_delta_y : 1; 102 bool affected_by_outer_viewport_bounds_delta_y : 1;
105 103
106 // Layer scale factor is used as a fallback when we either cannot adjust 104 // Layer scale factor is used as a fallback when we either cannot adjust
107 // raster scale or if the raster scale cannot be extracted from the screen 105 // raster scale or if the raster scale cannot be extracted from the screen
108 // space transform. For layers in the subtree of the page scale layer, the 106 // space transform. For layers in the subtree of the page scale layer, the
109 // layer scale factor should include the page scale factor. 107 // layer scale factor should include the page scale factor.
110 bool in_subtree_of_page_scale_layer : 1; 108 bool in_subtree_of_page_scale_layer : 1;
111 109
112 // We need to track changes to to_screen transform to compute the damage rect. 110 // We need to track changes to to_screen transform to compute the damage rect.
113 bool transform_changed : 1; 111 bool transform_changed : 1;
114 112
115 // TODO(vollick): will be moved when accelerated effects are implemented. 113 // TODO(vollick): will be moved when accelerated effects are implemented.
116 float post_local_scale_factor; 114 float post_local_scale_factor;
117 115
118 gfx::Vector2dF surface_contents_scale;
119
120 // TODO(vollick): will be moved when accelerated effects are implemented. 116 // TODO(vollick): will be moved when accelerated effects are implemented.
121 gfx::ScrollOffset scroll_offset; 117 gfx::ScrollOffset scroll_offset;
122 118
123 // We scroll snap where possible, but this means fixed-pos elements must be 119 // We scroll snap where possible, but this means fixed-pos elements must be
124 // adjusted. This value stores the snapped amount for this purpose. 120 // adjusted. This value stores the snapped amount for this purpose.
125 gfx::Vector2dF scroll_snap; 121 gfx::Vector2dF scroll_snap;
126 122
127 // TODO(vollick): will be moved when accelerated effects are implemented. 123 // TODO(vollick): will be moved when accelerated effects are implemented.
128 gfx::Vector2dF source_offset; 124 gfx::Vector2dF source_offset;
129 gfx::Vector2dF source_to_parent; 125 gfx::Vector2dF source_to_parent;
(...skipping 15 matching lines...) Expand all
145 141
146 void AsValueInto(base::trace_event::TracedValue* value) const; 142 void AsValueInto(base::trace_event::TracedValue* value) const;
147 }; 143 };
148 144
149 // TODO(sunxd): move this into PropertyTrees::cached_data_. 145 // TODO(sunxd): move this into PropertyTrees::cached_data_.
150 struct CC_EXPORT TransformCachedNodeData { 146 struct CC_EXPORT TransformCachedNodeData {
151 TransformCachedNodeData(); 147 TransformCachedNodeData();
152 TransformCachedNodeData(const TransformCachedNodeData& other); 148 TransformCachedNodeData(const TransformCachedNodeData& other);
153 ~TransformCachedNodeData(); 149 ~TransformCachedNodeData();
154 150
155 gfx::Transform from_target;
156 gfx::Transform to_target;
157 gfx::Transform from_screen; 151 gfx::Transform from_screen;
158 gfx::Transform to_screen; 152 gfx::Transform to_screen;
159 int target_id; 153 int target_id;
160 // This id is used for all content that draws into a render surface associated 154 // This id is used for all content that draws into a render surface associated
161 // with this transform node. 155 // with this transform node.
162 int content_target_id; 156 int content_target_id;
163 157
164 bool operator==(const TransformCachedNodeData& other) const; 158 bool operator==(const TransformCachedNodeData& other) const;
165 159
166 void ToProtobuf(proto::TransformCachedNodeData* proto) const; 160 void ToProtobuf(proto::TransformCachedNodeData* proto) const;
167 void FromProtobuf(const proto::TransformCachedNodeData& proto); 161 void FromProtobuf(const proto::TransformCachedNodeData& proto);
168 }; 162 };
169 163
170 } // namespace cc 164 } // namespace cc
171 165
172 #endif // CC_TREES_TRANSFORM_NODE_H_ 166 #endif // CC_TREES_TRANSFORM_NODE_H_
OLDNEW
« no previous file with comments | « cc/trees/property_tree_unittest.cc ('k') | cc/trees/transform_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698