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

Unified Diff: ui/gfx/transform_unittest.cc

Issue 692593003: More robust matrix decomposition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | ui/gfx/transform_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/transform_unittest.cc
diff --git a/ui/gfx/transform_unittest.cc b/ui/gfx/transform_unittest.cc
index 94b3b61a661f43031e021d3205a4737a5bebef51..4c5003171b8d3a71f0062cebd9a4912366a60068 100644
--- a/ui/gfx/transform_unittest.cc
+++ b/ui/gfx/transform_unittest.cc
@@ -1361,6 +1361,21 @@ TEST(XFormTest, FactorTRS) {
}
}
+TEST(XFormTest, DecomposeTransform) {
+ for (float scale = 0.001f; scale < 2.0f; scale += 0.001f) {
+ gfx::Transform transform;
+ transform.Scale(scale, scale);
+ EXPECT_TRUE(transform.Preserves2dAxisAlignment());
+
+ DecomposedTransform decomp;
+ bool success = DecomposeTransform(&decomp, transform);
+ EXPECT_TRUE(success);
+
+ gfx::Transform compose_transform = ComposeTransform(decomp);
+ EXPECT_TRUE(compose_transform.Preserves2dAxisAlignment());
+ }
+}
+
TEST(XFormTest, IntegerTranslation) {
gfx::Transform transform;
EXPECT_TRUE(transform.IsIdentityOrIntegerTranslation());
« no previous file with comments | « no previous file | ui/gfx/transform_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698