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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 2451273003: cc : Snap texture layers to pixel boundary (Closed)
Patch Set: 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
Index: cc/trees/property_tree_builder.cc
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc
index 17ed191d074f8376327c66cc192f0c4267ff7e75..72528646e1507e7feae222c456f57ee34f163049 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);
enne (OOO) 2016/10/26 20:32:33 I wish we had DCHECK_IMPLIES. :C
jaydasika 2016/10/26 21:49:14 I wish that too. Just in this CL, I have 3 DCHECK(
+ 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();

Powered by Google App Engine
This is Rietveld 408576698