diff options
author | reed <reed@google.com> | 2014-09-29 12:10:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-29 12:10:27 -0700 |
commit | c5e15a1afab2621e860a251c3fcf5917867ad49f (patch) | |
tree | 52a68d8103a78776d05f5c933b4f715dd7828633 /tests/BitmapCopyTest.cpp | |
parent | 4572ae9221a2bef60a2867682b738715a431f3a6 (diff) |
remove alphatype from colortable
the owning bitmap is (already) responsible for knowing the alphatype
BUG=skia:
R=djsollen@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/611093002
Diffstat (limited to 'tests/BitmapCopyTest.cpp')
-rw-r--r-- | tests/BitmapCopyTest.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp index 3923846226..eb7c663254 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; |