From b1560445c66a751fc2ea7b85b94430a985940f3e Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Thu, 19 Dec 2013 22:28:48 +0000 Subject: Revert "begin to remove SkLONGLONG and wean Skia off of Sk64" This reverts commit 784890196fdab96289f9389db43aca01f35db0f9. Revert "use LL suffix for 64bit literal" This reverts commit 9634295aff9bffd7a3875a0ca4a9b1a27d0793fc. BUG= Review URL: https://codereview.chromium.org/116543009 git-svn-id: http://skia.googlecode.com/svn/trunk@12790 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/MathTest.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tests/MathTest.cpp') diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp index 3efbbcb9fc..1b8954a361 100644 --- a/tests/MathTest.cpp +++ b/tests/MathTest.cpp @@ -188,6 +188,7 @@ static void test_blend(skiatest::Reporter* reporter) { } } +#if defined(SkLONGLONG) static int symmetric_fixmul(int a, int b) { int sa = SkExtractSign(a); int sb = SkExtractSign(b); @@ -195,9 +196,19 @@ static int symmetric_fixmul(int a, int b) { a = SkApplySign(a, sa); b = SkApplySign(b, sb); - int c = (int)(((int64_t)a * b) >> 16); +#if 1 + int c = (int)(((SkLONGLONG)a * b) >> 16); + return SkApplySign(c, sa ^ sb); +#else + SkLONGLONG ab = (SkLONGLONG)a * b; + if (sa ^ sb) { + ab = -ab; + } + return ab >> 16; +#endif } +#endif static void check_length(skiatest::Reporter* reporter, const SkPoint& p, SkScalar targetLen) { @@ -481,11 +492,12 @@ DEF_TEST(Math, reporter) { unittest_fastfloat(reporter); unittest_isfinite(reporter); +#ifdef SkLONGLONG for (i = 0; i < 10000; i++) { SkFixed numer = rand.nextS(); SkFixed denom = rand.nextS(); SkFixed result = SkFixedDiv(numer, denom); - int64_t check = ((int64_t)numer << 16) / denom; + SkLONGLONG check = ((SkLONGLONG)numer << 16) / denom; (void)SkCLZ(numer); (void)SkCLZ(denom); @@ -510,6 +522,7 @@ DEF_TEST(Math, reporter) { r2 = SkFixedSquare(numer); REPORTER_ASSERT(reporter, result == r2); } +#endif test_blend(reporter); -- cgit v1.2.3