Revert of https://codereview.chromium.org/113823003/
Reason for revert: need to update callsites in linux codecs
R=robertphillips@google.com
TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=
Author: reed@google.com
Review URL: https://codereview.chromium.org/122283002
git-svn-id: http://skia.googlecode.com/svn/trunk@12841 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index 455fc69..7a1d9ac 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -343,8 +343,8 @@
SkBitmap tstSafeSize;
tstSafeSize.setConfig(gPairs[i].fConfig, 100000000U,
100000000U);
- int64_t safeSize = tstSafeSize.computeSafeSize64();
- if (safeSize < 0) {
+ Sk64 safeSize = tstSafeSize.getSafeSize64();
+ if (safeSize.isNeg()) {
SkString str;
str.printf("getSafeSize64() negative: %s",
getSkConfigName(tstSafeSize));
@@ -358,20 +358,20 @@
case SkBitmap::kA8_Config:
case SkBitmap::kIndex8_Config:
- if (safeSize != 0x2386F26FC10000LL) {
+ if (safeSize.as64() != 0x2386F26FC10000LL) {
sizeFail = true;
}
break;
case SkBitmap::kRGB_565_Config:
case SkBitmap::kARGB_4444_Config:
- if (safeSize != 0x470DE4DF820000LL) {
+ if (safeSize.as64() != 0x470DE4DF820000LL) {
sizeFail = true;
}
break;
case SkBitmap::kARGB_8888_Config:
- if (safeSize != 0x8E1BC9BF040000LL) {
+ if (safeSize.as64() != 0x8E1BC9BF040000LL) {
sizeFail = true;
}
break;
@@ -381,7 +381,7 @@
}
if (sizeFail) {
SkString str;
- str.printf("computeSafeSize64() wrong size: %s",
+ str.printf("getSafeSize64() wrong size: %s",
getSkConfigName(tstSafeSize));
reporter->reportFailed(str);
}
diff --git a/tests/Sk64Test.cpp b/tests/Sk64Test.cpp
index d668e54..1777d24 100644
--- a/tests/Sk64Test.cpp
+++ b/tests/Sk64Test.cpp
@@ -7,7 +7,6 @@
#include "Test.h"
#include "TestClassDef.h"
-#include "Sk64.h"
#include "SkRandom.h"
#include <math.h>
@@ -93,8 +92,8 @@
}
for (i = 0; i < 1000; i++) {
- a.set64(rand.next64());
- b.set64(rand.next64());
+ rand.next64(&a); //a.fHi >>= 1; // avoid overflow
+ rand.next64(&b); //b.fHi >>= 1; // avoid overflow
if (!(i & 3)) // want to explicitly test these cases
{