From 8f4d2306fa866a26f9448048ff63f692b2ba43aa Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Tue, 17 Dec 2013 16:44:46 +0000 Subject: remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats To keep the CL (slightly) managable, this does not make any changes to existing macros (e.g. SkScalarMul). Just tackling #ifdef constructs this time around. BUG= R=bsalomon@google.com, caryclark@google.com Review URL: https://codereview.chromium.org/117053002 git-svn-id: http://skia.googlecode.com/svn/trunk@12712 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/MathTest.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'tests/MathTest.cpp') diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp index 22680c13e6..d6649542c2 100644 --- a/tests/MathTest.cpp +++ b/tests/MathTest.cpp @@ -328,14 +328,11 @@ static void unittest_fastfloat(skiatest::Reporter* reporter) { } } -#ifdef SK_SCALAR_IS_FLOAT static float make_zero() { return sk_float_sin(0); } -#endif static void unittest_isfinite(skiatest::Reporter* reporter) { -#ifdef SK_SCALAR_IS_FLOAT float nan = sk_float_asin(2); float inf = 1.0f / make_zero(); float big = 3.40282e+038f; @@ -344,10 +341,6 @@ static void unittest_isfinite(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, !SkScalarIsNaN(-inf)); REPORTER_ASSERT(reporter, !SkScalarIsFinite(inf)); REPORTER_ASSERT(reporter, !SkScalarIsFinite(-inf)); -#else - SkFixed nan = SK_FixedNaN; - SkFixed big = SK_FixedMax; -#endif REPORTER_ASSERT(reporter, SkScalarIsNaN(nan)); REPORTER_ASSERT(reporter, !SkScalarIsNaN(big)); @@ -607,37 +600,7 @@ DEF_TEST(Math, reporter) { REPORTER_ASSERT(reporter, xr == check || xr == check-1); } -#if !defined(SK_SCALAR_IS_FLOAT) - { - SkFixed s, c; - s = SkFixedSinCos(0, &c); - REPORTER_ASSERT(reporter, s == 0); - REPORTER_ASSERT(reporter, c == SK_Fixed1); - } - - int maxDiff = 0; - for (i = 0; i < 1000; i++) { - SkFixed rads = rand.nextS() >> 10; - double frads = SkFixedToFloat(rads); - - SkFixed s, c; - s = SkScalarSinCos(rads, &c); - - double fs = sin(frads); - double fc = cos(frads); - - SkFixed is = SkFloatToFixed(fs); - SkFixed ic = SkFloatToFixed(fc); - - maxDiff = SkMax32(maxDiff, SkAbs32(is - s)); - maxDiff = SkMax32(maxDiff, SkAbs32(ic - c)); - } - SkDebugf("SinCos: maximum error = %d\n", maxDiff); -#endif - -#ifdef SK_SCALAR_IS_FLOAT test_blend(reporter); -#endif if (false) test_floor(reporter); -- cgit v1.2.3