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

Unified Diff: tests/Matrix44Test.cpp

Issue 1169813006: Use SkMScalar as float by default to match Chromium. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Tweak some test values to pass with floats. Created 5 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 | « include/core/SkPostConfig.h ('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 939675499c83be7a0c9c80abc17d1e106f956e0e..cd11a7da2d0ea5b9460eb44072153993d04d82e7 100644
--- a/tests/Matrix44Test.cpp
+++ b/tests/Matrix44Test.cpp
@@ -368,15 +368,15 @@ static void test_invert(skiatest::Reporter* reporter) {
0, 0, 0, 1);
SkMatrix44 scaleTranslation(SkMatrix44::kUninitialized_Constructor);
- scaleTranslation.setScale(10, 100, 1000);
+ scaleTranslation.setScale(32, 128, 1024);
scaleTranslation.preTranslate(2, 3, 4);
scaleTranslation.invert(&inverse);
inverse.asRowMajord(inverseData);
assert16<double>(reporter, inverseData,
- 0.1, 0, 0, -2,
- 0, 0.01, 0, -3,
- 0, 0, 0.001, -4,
- 0, 0, 0, 1);
+ 0.03125, 0, 0, -2,
+ 0, 0.0078125, 0, -3,
+ 0, 0, 0.0009765625, -4,
+ 0, 0, 0, 1);
SkMatrix44 rotation(SkMatrix44::kUninitialized_Constructor);
rotation.setRotateDegreesAbout(0, 0, 1, 90);
@@ -831,14 +831,14 @@ DEF_TEST(Matrix44, reporter) {
// test mixed-valued matrix inverse
mat.reset();
- mat.setScale(SkDoubleToMScalar(1.0e-10),
+ mat.setScale(SkDoubleToMScalar(1.0e-2),
SkDoubleToMScalar(3.0),
- SkDoubleToMScalar(1.0e+10));
+ SkDoubleToMScalar(1.0e+2));
rot.setRotateDegreesAbout(0, 0, -1, 90);
mat.postConcat(rot);
- mat.postTranslate(SkDoubleToMScalar(1.0e+10),
+ mat.postTranslate(SkDoubleToMScalar(1.0e+2),
SkDoubleToMScalar(3.0),
- SkDoubleToMScalar(1.0e-10));
+ SkDoubleToMScalar(1.0e-2));
REPORTER_ASSERT(reporter, mat.invert(NULL));
mat.invert(&inverse);
iden1.setConcat(mat, inverse);
« no previous file with comments | « include/core/SkPostConfig.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698