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

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

Issue 2451273003: cc : Snap texture layers to pixel boundary (Closed)
Patch Set: 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
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 should_be_snapped : 1;
98
97 bool needs_surface_contents_scale : 1; 99 bool needs_surface_contents_scale : 1;
98 100
99 // These are used to position nodes wrt the right or bottom of the inner or 101 // These are used to position nodes wrt the right or bottom of the inner or
100 // outer viewport. 102 // outer viewport.
101 bool affected_by_inner_viewport_bounds_delta_x : 1; 103 bool affected_by_inner_viewport_bounds_delta_x : 1;
102 bool affected_by_inner_viewport_bounds_delta_y : 1; 104 bool affected_by_inner_viewport_bounds_delta_y : 1;
103 bool affected_by_outer_viewport_bounds_delta_x : 1; 105 bool affected_by_outer_viewport_bounds_delta_x : 1;
104 bool affected_by_outer_viewport_bounds_delta_y : 1; 106 bool affected_by_outer_viewport_bounds_delta_y : 1;
105 107
106 // Layer scale factor is used as a fallback when we either cannot adjust 108 // 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 109 // 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 110 // space transform. For layers in the subtree of the page scale layer, the
109 // layer scale factor should include the page scale factor. 111 // layer scale factor should include the page scale factor.
110 bool in_subtree_of_page_scale_layer : 1; 112 bool in_subtree_of_page_scale_layer : 1;
111 113
112 // We need to track changes to to_screen transform to compute the damage rect. 114 // We need to track changes to to_screen transform to compute the damage rect.
113 bool transform_changed : 1; 115 bool transform_changed : 1;
114 116
115 // TODO(vollick): will be moved when accelerated effects are implemented. 117 // TODO(vollick): will be moved when accelerated effects are implemented.
116 float post_local_scale_factor; 118 float post_local_scale_factor;
117 119
118 gfx::Vector2dF surface_contents_scale; 120 gfx::Vector2dF surface_contents_scale;
119 121
120 // TODO(vollick): will be moved when accelerated effects are implemented. 122 // TODO(vollick): will be moved when accelerated effects are implemented.
121 gfx::ScrollOffset scroll_offset; 123 gfx::ScrollOffset scroll_offset;
122 124
123 // We scroll snap where possible, but this means fixed-pos elements must be 125 // This value stores the snapped amount whenever we snap. If the snap is due
124 // adjusted. This value stores the snapped amount for this purpose. 126 // to a scroll, we need it to calculate fixed-pos elements adjustment, even
125 gfx::Vector2dF scroll_snap; 127 // otherwise we may need it to undo the snapping next frame.
128 gfx::Vector2dF snap_amount;
126 129
127 // TODO(vollick): will be moved when accelerated effects are implemented. 130 // TODO(vollick): will be moved when accelerated effects are implemented.
128 gfx::Vector2dF source_offset; 131 gfx::Vector2dF source_offset;
129 gfx::Vector2dF source_to_parent; 132 gfx::Vector2dF source_to_parent;
130 133
131 bool operator==(const TransformNode& other) const; 134 bool operator==(const TransformNode& other) const;
132 135
133 void set_to_parent(const gfx::Transform& transform) { 136 void set_to_parent(const gfx::Transform& transform) {
134 to_parent = transform; 137 to_parent = transform;
135 is_invertible = to_parent.IsInvertible(); 138 is_invertible = to_parent.IsInvertible();
(...skipping 27 matching lines...) Expand all
163 166
164 bool operator==(const TransformCachedNodeData& other) const; 167 bool operator==(const TransformCachedNodeData& other) const;
165 168
166 void ToProtobuf(proto::TransformCachedNodeData* proto) const; 169 void ToProtobuf(proto::TransformCachedNodeData* proto) const;
167 void FromProtobuf(const proto::TransformCachedNodeData& proto); 170 void FromProtobuf(const proto::TransformCachedNodeData& proto);
168 }; 171 };
169 172
170 } // namespace cc 173 } // namespace cc
171 174
172 #endif // CC_TREES_TRANSFORM_NODE_H_ 175 #endif // CC_TREES_TRANSFORM_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698