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

Unified Diff: tests/BitmapCopyTest.cpp

Issue 25275004: store SkAlphaType inside SkBitmap, on road to support unpremul (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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
Index: tests/BitmapCopyTest.cpp
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index cccde8af92eb56ba95b90a78a45463f9d197f303..bf0d2f7813889f53fb0a0173445421fb33b30b3b 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -249,8 +249,8 @@ static void TestBitmapCopy(skiatest::Reporter* reporter) {
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 @@ static void TestBitmapCopy(skiatest::Reporter* reporter) {
srcPremul.allocPixels(ctPremul);
SkSafeUnref(ctOpaque);
SkSafeUnref(ctPremul);
-
- srcOpaque.setIsOpaque(true);
- srcPremul.setIsOpaque(false);
}
init_src(srcOpaque);
init_src(srcPremul);
@@ -315,7 +312,7 @@ static void TestBitmapCopy(skiatest::Reporter* reporter) {
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 @@ static void TestBitmapCopy(skiatest::Reporter* reporter) {
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);
}

Powered by Google App Engine
This is Rietveld 408576698