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

Unified Diff: tests/MathTest.cpp

Issue 18539004: ARM Skia NEON patches - 04 - Clean SkFixed / SkLONGLONG (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove SkLONGLONG + use int64_t where there was an existing long long SkFixed implementation Created 7 years, 4 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 | « src/core/SkMath.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 fe54594100bc97f62586a0dc33cbd444d64ffb62..f9849194cb91f5dd10aa81b657ec6fe8d122cbd4 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -186,7 +186,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);
@@ -195,18 +194,17 @@ static int symmetric_fixmul(int a, int b) {
b = SkApplySign(b, sb);
#if 1
- int c = (int)(((SkLONGLONG)a * b) >> 16);
+ int c = (int)(((int64_t)a * b) >> 16);
return SkApplySign(c, sa ^ sb);
#else
- SkLONGLONG ab = (SkLONGLONG)a * b;
+ int64_t ab = (int64_t)a * b;
if (sa ^ sb) {
ab = -ab;
}
return ab >> 16;
#endif
}
-#endif
static void check_length(skiatest::Reporter* reporter,
const SkPoint& p, SkScalar targetLen) {
@@ -522,12 +520,11 @@ static void TestMath(skiatest::Reporter* 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);
@@ -541,7 +538,7 @@ static void TestMath(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, result == (int32_t)check);
result = SkFractDiv(numer, denom);
- check = ((SkLONGLONG)numer << 30) / denom;
+ check = ((int64_t)numer << 30) / denom;
REPORTER_ASSERT(reporter, result != (SkFixed)SK_NaN32);
if (check > SK_MaxS32) {
@@ -583,7 +580,6 @@ static void TestMath(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, (diff >> 7) == 0);
}
}
-#endif
for (i = 0; i < 10000; i++) {
SkFract x = rand.nextU() >> 1;
« no previous file with comments | « src/core/SkMath.cpp ('k') | tests/Sk64Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698