store SkAlphaType inside SkBitmap, on road to support unpremul
BUG=
R=bsalomon@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/25275004
git-svn-id: http://skia.googlecode.com/svn/trunk@11877 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index cccde8a..bf0d2f7 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -249,8 +249,8 @@
SkColorTable* ctOpaque = NULL;
SkColorTable* ctPremul = NULL;
- srcOpaque.setConfig(gPairs[i].fConfig, W, H);
- srcPremul.setConfig(gPairs[i].fConfig, W, H);
+ srcOpaque.setConfig(gPairs[i].fConfig, W, H, 0, kOpaque_SkAlphaType);
+ srcPremul.setConfig(gPairs[i].fConfig, W, H, 0, kPremul_SkAlphaType);
if (SkBitmap::kIndex8_Config == gPairs[i].fConfig) {
ctOpaque = init_ctable(kOpaque_SkAlphaType);
ctPremul = init_ctable(kPremul_SkAlphaType);
@@ -259,9 +259,6 @@
srcPremul.allocPixels(ctPremul);
SkSafeUnref(ctOpaque);
SkSafeUnref(ctPremul);
-
- srcOpaque.setIsOpaque(true);
- srcPremul.setIsOpaque(false);
}
init_src(srcOpaque);
init_src(srcPremul);
@@ -315,7 +312,7 @@
REPORTER_ASSERT(reporter, subset.width() == 1);
REPORTER_ASSERT(reporter, subset.height() == 1);
REPORTER_ASSERT(reporter,
- subset.isOpaque() == bitmap.isOpaque());
+ subset.alphaType() == bitmap.alphaType());
REPORTER_ASSERT(reporter,
subset.isVolatile() == true);
@@ -333,12 +330,11 @@
REPORTER_ASSERT(reporter,
(copy.getColorTable() != NULL) == hasCT);
}
-
bitmap = srcPremul;
bitmap.setIsVolatile(false);
if (bitmap.extractSubset(&subset, r)) {
REPORTER_ASSERT(reporter,
- subset.isOpaque() == bitmap.isOpaque());
+ subset.alphaType() == bitmap.alphaType());
REPORTER_ASSERT(reporter,
subset.isVolatile() == false);
}