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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 2451273003: cc : Snap texture layers to pixel boundary (Closed)
Patch Set: comments Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/property_tree.cc ('k') | cc/trees/property_tree_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree_builder.cc
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc
index 13fc8cad774b0d2e1936e4ad564f1e1b7cf9242e..3319146ddaa607ae364ac18e52f5e6a8aa0cccd4 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -493,6 +493,7 @@ bool AddTransformNodeIfNeeded(
const bool is_scrollable = layer->scrollable();
const bool is_fixed = PositionConstraint(layer).is_fixed_position();
const bool is_sticky = StickyPositionConstraint(layer).is_sticky;
+ const bool is_snapped = layer->IsSnapped();
const bool has_significant_transform =
!Transform(layer).IsIdentityOr2DTranslation();
@@ -523,7 +524,8 @@ bool AddTransformNodeIfNeeded(
const bool is_at_boundary_of_3d_rendering_context =
IsAtBoundaryOf3dRenderingContext(layer);
- bool requires_node = is_root || is_scrollable || has_significant_transform ||
+ DCHECK(!is_scrollable || is_snapped);
+ bool requires_node = is_root || is_snapped || has_significant_transform ||
has_any_transform_animation || has_surface || is_fixed ||
is_page_scale_layer || is_overscroll_elasticity_layer ||
has_proxied_transform_related_property ||
@@ -599,6 +601,7 @@ bool AddTransformNodeIfNeeded(
node->id;
node->scrolls = is_scrollable;
+ node->should_be_snapped = is_snapped;
node->flattens_inherited_transform = data_for_children->should_flatten;
node->sorting_context_id = layer->sorting_context_id();
« no previous file with comments | « cc/trees/property_tree.cc ('k') | cc/trees/property_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698