init src either opaquely (e.g. white), or with a valid ctable index (e.g. 0)
git-svn-id: http://skia.googlecode.com/svn/trunk@680 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index c07630d..1878dfa 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -62,10 +62,14 @@
}
}
-static void init_src(const SkBitmap& bitmap) {
+static void init_src(const SkBitmap& bitmap, const SkColorTable* ct) {
SkAutoLockPixels lock(bitmap);
if (bitmap.getPixels()) {
- memset(bitmap.getPixels(), 4, bitmap.getSize());
+ if (ct) {
+ sk_bzero(bitmap.getPixels(), bitmap.getSize());
+ } else {
+ bitmap.eraseColor(SK_ColorWHITE);
+ }
}
}
@@ -259,7 +263,7 @@
src.allocPixels(ct);
SkSafeUnref(ct);
- init_src(src);
+ init_src(src, ct);
bool success = src.copyTo(&dst, gPairs[j].fConfig);
bool expected = gPairs[i].fValid[j] != '0';
if (success != expected) {