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

Unified Diff: tests/Matrix44Test.cpp

Issue 2098583002: SkMatrix44 clarifications and clean-ups (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « tests/ColorSpaceTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Matrix44Test.cpp
diff --git a/tests/Matrix44Test.cpp b/tests/Matrix44Test.cpp
index f4b6783c3649b1f6838e33dcb8b2341e78fa87a1..75086b68ae673aae8a27b08a64fd0b39c0a3ad67 100644
--- a/tests/Matrix44Test.cpp
+++ b/tests/Matrix44Test.cpp
@@ -484,6 +484,23 @@ static void test_get_set_double(skiatest::Reporter* reporter) {
}
}
+static void test_set_3x3(skiatest::Reporter* r) {
+ static float vals[9] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, };
+
+ SkMatrix44 mat(SkMatrix44::kUninitialized_Constructor);
+ mat.set3x3RowMajorf(vals);
+
+ REPORTER_ASSERT(r, 1.0f == mat.getFloat(0, 0));
+ REPORTER_ASSERT(r, 2.0f == mat.getFloat(0, 1));
+ REPORTER_ASSERT(r, 3.0f == mat.getFloat(0, 2));
+ REPORTER_ASSERT(r, 4.0f == mat.getFloat(1, 0));
+ REPORTER_ASSERT(r, 5.0f == mat.getFloat(1, 1));
+ REPORTER_ASSERT(r, 6.0f == mat.getFloat(1, 2));
+ REPORTER_ASSERT(r, 7.0f == mat.getFloat(2, 0));
+ REPORTER_ASSERT(r, 8.0f == mat.getFloat(2, 1));
+ REPORTER_ASSERT(r, 9.0f == mat.getFloat(2, 2));
+}
+
static void test_set_row_col_major(skiatest::Reporter* reporter) {
SkMatrix44 a(SkMatrix44::kUninitialized_Constructor);
SkMatrix44 b(SkMatrix44::kUninitialized_Constructor);
@@ -916,6 +933,7 @@ DEF_TEST(Matrix44, reporter) {
test_transpose(reporter);
test_get_set_double(reporter);
test_set_row_col_major(reporter);
+ test_set_3x3(reporter);
test_translate(reporter);
test_scale(reporter);
test_map2(reporter);
« no previous file with comments | « tests/ColorSpaceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698