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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 216973006: Fix fixed-pos jitter related to physical pixel snapping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set fallback value to 1 Created 6 years, 9 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 | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index c1bc1a12c4dff940fccb6e5f4c4bbb2e89d79213..5d0c9afc1929f57e8fa69ab66dd5e2d0b3069ff4 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -1529,8 +1529,17 @@ static void CalculateDrawPropertiesInternal(
gfx::Vector2dF current_translation = combined_transform.To2dTranslation();
// This rounding changes the scroll delta, and so must be included
- // in the scroll compensation matrix.
- effective_scroll_delta -= current_translation - previous_translation;
+ // in the scroll compensation matrix. The scaling converts from physical
+ // coordinates to the scroll delta's CSS coordinates (using the parent
+ // matrix instead of combined transform since scrolling is applied before
+ // the layer's transform). For example, if we have a total scale factor of
+ // 3.0, then 1 physical pixel is only 1/3 of a CSS pixel.
+ gfx::Vector2dF parent_scales = MathUtil::ComputeTransform2dScaleComponents(
+ data_from_ancestor.parent_matrix, 1.f);
+ effective_scroll_delta -=
+ gfx::ScaleVector2d(current_translation - previous_translation,
+ 1.f / parent_scales.x(),
+ 1.f / parent_scales.y());
}
// Apply adjustment from position constraints.
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698