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

Unified Diff: cc/layers/layer_utils_unittest.cc

Issue 295193002: Get rid of graphics layer anchor points, and replace with transform origin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit. Created 6 years, 6 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/layers/layer_utils.cc ('k') | cc/layers/nine_patch_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_utils_unittest.cc
diff --git a/cc/layers/layer_utils_unittest.cc b/cc/layers/layer_utils_unittest.cc
index 3a8d99c2e06b8230f9a0752e90a78c236a5331d9..bf4e9dba4a7a6e296ca590168b954fe89cb10b59 100644
--- a/cc/layers/layer_utils_unittest.cc
+++ b/cc/layers/layer_utils_unittest.cc
@@ -165,6 +165,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateXNoPerspective) {
child()->draw_properties().screen_space_transform_is_animating = true;
child()->SetPosition(gfx::PointF(150.f, 50.f));
child()->SetBounds(bounds);
+ child()->SetTransformOrigin(
+ gfx::Point3F(bounds.width() * 0.5f, bounds.height() * 0.5f, 0));
gfx::BoxF box;
bool success = LayerUtils::GetAnimationBounds(*child(), &box);
@@ -184,7 +186,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateXWithPerspective) {
// Make the anchor point not the default 0.5 value and line up with the
// child center to make the math easier.
- parent()->SetAnchorPoint(gfx::PointF(0.375f, 0.375f));
+ parent()->SetTransformOrigin(
+ gfx::Point3F(0.375f * 400.f, 0.375f * 400.f, 0.f));
parent()->SetBounds(gfx::Size(400, 400));
gfx::Transform perspective;
@@ -196,6 +199,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateXWithPerspective) {
child()->draw_properties().screen_space_transform_is_animating = true;
child()->SetPosition(gfx::PointF(100.f, 100.f));
child()->SetBounds(bounds);
+ child()->SetTransformOrigin(
+ gfx::Point3F(bounds.width() * 0.5f, bounds.height() * 0.5f, 0));
gfx::BoxF box;
bool success = LayerUtils::GetAnimationBounds(*child(), &box);
@@ -220,6 +225,8 @@ TEST_F(LayerUtilsGetAnimationBoundsTest, RotateZ) {
child()->draw_properties().screen_space_transform_is_animating = true;
child()->SetPosition(gfx::PointF(150.f, 50.f));
child()->SetBounds(bounds);
+ child()->SetTransformOrigin(
+ gfx::Point3F(bounds.width() * 0.5f, bounds.height() * 0.5f, 0));
gfx::BoxF box;
bool success = LayerUtils::GetAnimationBounds(*child(), &box);
« no previous file with comments | « cc/layers/layer_utils.cc ('k') | cc/layers/nine_patch_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698