aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Matrix44Test.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-06-24 18:13:39 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-06-24 18:13:39 +0000
commit6f2b44d2ff24dd704aa673ab653371d62c1ac931 (patch)
tree7f5df5dd566146ebf83a1e276a39ec89d42f162d /tests/Matrix44Test.cpp
parent6d2a6a400bd22c8bce0f515822cee3fb524acc93 (diff)
add (disabled) tests for common angles
git-svn-id: http://skia.googlecode.com/svn/trunk@1708 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/Matrix44Test.cpp')
-rw-r--r--tests/Matrix44Test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Matrix44Test.cpp b/tests/Matrix44Test.cpp
index 6ee70eb40f..67dc0d252f 100644
--- a/tests/Matrix44Test.cpp
+++ b/tests/Matrix44Test.cpp
@@ -57,6 +57,18 @@ static bool is_identity(const SkMatrix44& m) {
return nearly_equal(m, identity);
}
+static void test_common_angles(skiatest::Reporter* reporter) {
+ SkMatrix44 rot;
+ // Test precision of rotation in common cases
+ int common_angles[] = { 0, 90, -90, 180, -180, 270, -270, 360, -360 };
+ for (int i = 0; i < 9; ++i) {
+ rot.setRotateDegreesAbout(0, 0, -1, common_angles[i]);
+
+ SkMatrix rot3x3 = rot;
+ REPORTER_ASSERT(reporter, rot3x3.rectStaysRect());
+ }
+}
+
void TestMatrix44(skiatest::Reporter* reporter) {
#ifdef SK_SCALAR_IS_FLOAT
SkMatrix44 mat, inverse, iden1, iden2, rot;
@@ -119,6 +131,10 @@ void TestMatrix44(skiatest::Reporter* reporter) {
0, 0, 1, 4,
0, 0, 0, 1);
}
+
+#if 0 // working on making this pass
+ test_common_angles(reporter);
+#endif
#endif
}