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

Unified Diff: tests/MathTest.cpp

Issue 119353003: Revert "Revert "begin to remove SkLONGLONG and wean Skia off of Sk64"" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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/BitmapCopyTest.cpp ('k') | tests/Sk64Test.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/MathTest.cpp
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index 1b8954a361e689848ba10a809c06779ea396a0fe..8cba67dd3d49528db789aceecdf0fca05e0995bc 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -188,28 +188,6 @@ 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);
-
- a = SkApplySign(a, sa);
- b = SkApplySign(b, sb);
-
-#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) {
float x = SkScalarToFloat(p.fX);
@@ -492,12 +470,11 @@ 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);
- SkLONGLONG check = ((SkLONGLONG)numer << 16) / denom;
+ int64_t check = ((int64_t)numer << 16) / denom;
(void)SkCLZ(numer);
(void)SkCLZ(denom);
@@ -509,20 +486,7 @@ DEF_TEST(Math, reporter) {
check = SK_MinS32;
}
REPORTER_ASSERT(reporter, result == (int32_t)check);
-
- // make them <= 2^24, so we don't overflow in fixmul
- numer = numer << 8 >> 8;
- denom = denom << 8 >> 8;
-
- result = SkFixedMul(numer, denom);
- SkFixed r2 = symmetric_fixmul(numer, denom);
- // SkASSERT(result == r2);
-
- result = SkFixedMul(numer, numer);
- r2 = SkFixedSquare(numer);
- REPORTER_ASSERT(reporter, result == r2);
}
-#endif
test_blend(reporter);
« no previous file with comments | « tests/BitmapCopyTest.cpp ('k') | tests/Sk64Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698