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

Unified Diff: cc/trees/layer_tree_host_common_unittest.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 | « cc/trees/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index d6c7cf783a2807d7fe7f6901c1c150f64d4c708e..61e49f74a1a07556aa4278c22a48e376f0a832b2 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -9689,6 +9689,51 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) {
.screen_space_transform.To2dTranslation(),
container_offset - rounded_scroll_delta);
}
+
+ // Scale is applied earlier in the tree.
+ {
+ gfx::Transform scaled_container_transform = container_transform;
+ scaled_container_transform.Scale3d(3.0, 3.0, 1.0);
+ container_layer->SetTransform(scaled_container_transform);
+
+ gfx::Vector2dF scroll_delta(4.5f, 8.5f);
+ scroll_layer->SetScrollDelta(scroll_delta);
+
+ LayerImplList render_surface_layer_list;
+ LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
+ root.get(), root->bounds(), &render_surface_layer_list);
+ LayerTreeHostCommon::CalculateDrawProperties(&inputs);
+
+ EXPECT_TRANSFORMATION_MATRIX_EQ(
+ container_layer->draw_properties().screen_space_transform,
+ fixed_layer->draw_properties().screen_space_transform);
+ EXPECT_VECTOR_EQ(
+ fixed_layer->draw_properties().screen_space_transform.To2dTranslation(),
+ container_offset);
+
+ container_layer->SetTransform(container_transform);
+ }
+
+ // Scale is applied on the scroll layer itself.
+ {
+ gfx::Transform scale_transform;
+ scale_transform.Scale3d(3.0, 3.0, 1.0);
+ scroll_layer->SetTransform(scale_transform);
+
+ gfx::Vector2dF scroll_delta(4.5f, 8.5f);
+ scroll_layer->SetScrollDelta(scroll_delta);
+
+ LayerImplList render_surface_layer_list;
+ LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
+ root.get(), root->bounds(), &render_surface_layer_list);
+ LayerTreeHostCommon::CalculateDrawProperties(&inputs);
+
+ EXPECT_VECTOR_EQ(
+ fixed_layer->draw_properties().screen_space_transform.To2dTranslation(),
+ container_offset);
+
+ scroll_layer->SetTransform(identity_transform);
+ }
}
} // namespace
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698