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

Unified Diff: tests/BitmapCopyTest.cpp

Issue 611093002: remove alphatype from colortable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update codecs Created 6 years, 3 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/images/SkImageDecoder_wbmp.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/BitmapCopyTest.cpp
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index 3923846226ce42034a7636d10724f7e32f85329b..eb7c663254af2962b13cb9bd90c92f1eaf893de4 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -61,11 +61,11 @@ static void init_src(const SkBitmap& bitmap) {
}
}
-static SkColorTable* init_ctable(SkAlphaType alphaType) {
+static SkColorTable* init_ctable() {
static const SkColor colors[] = {
SK_ColorBLACK, SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE
};
- return new SkColorTable(colors, SK_ARRAY_COUNT(colors), alphaType);
+ return new SkColorTable(colors, SK_ARRAY_COUNT(colors));
}
struct Pair {
@@ -196,19 +196,16 @@ static const int H = 33;
static void setup_src_bitmaps(SkBitmap* srcOpaque, SkBitmap* srcPremul,
SkColorType ct) {
- SkColorTable* ctOpaque = NULL;
- SkColorTable* ctPremul = NULL;
+ SkColorTable* ctable = NULL;
if (kIndex_8_SkColorType == ct) {
- ctOpaque = init_ctable(kOpaque_SkAlphaType);
- ctPremul = init_ctable(kPremul_SkAlphaType);
+ ctable = init_ctable();
}
srcOpaque->allocPixels(SkImageInfo::Make(W, H, ct, kOpaque_SkAlphaType),
- NULL, ctOpaque);
+ NULL, ctable);
srcPremul->allocPixels(SkImageInfo::Make(W, H, ct, kPremul_SkAlphaType),
- NULL, ctPremul);
- SkSafeUnref(ctOpaque);
- SkSafeUnref(ctPremul);
+ NULL, ctable);
+ SkSafeUnref(ctable);
init_src(*srcOpaque);
init_src(*srcPremul);
}
@@ -384,7 +381,7 @@ DEF_TEST(BitmapCopy, reporter) {
SkBitmap src, subset;
SkColorTable* ct = NULL;
if (kIndex_8_SkColorType == src.colorType()) {
- ct = init_ctable(kPremul_SkAlphaType);
+ ct = init_ctable();
}
int localSubW;
« no previous file with comments | « src/images/SkImageDecoder_wbmp.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698