diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-17 21:21:46 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-17 21:21:46 +0000 |
commit | dac522589e9395b4654a1a708f1bd971f37f95a5 (patch) | |
tree | 3190dc309541bf8b706bee789b0a9ffce1771728 /gm/bitmappremul.cpp | |
parent | 5c056399259bb7ec06ff1eb8ce904001b363276c (diff) |
replace SkBitmap::Config with SkColorType in gms
add helper installMaskPixels() to SkBitmap
BUG=skia:
R=halcanary@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/169913003
git-svn-id: http://skia.googlecode.com/svn/trunk@13482 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/bitmappremul.cpp')
-rw-r--r-- | gm/bitmappremul.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gm/bitmappremul.cpp b/gm/bitmappremul.cpp index 57d22d700a..fd563eb775 100644 --- a/gm/bitmappremul.cpp +++ b/gm/bitmappremul.cpp @@ -22,14 +22,15 @@ static const int SLIDE_SIZE = 256; static const int PIXEL_SIZE_8888 = SLIDE_SIZE / 256; static const int PIXEL_SIZE_4444 = SLIDE_SIZE / 16; -static void init_bitmap(SkBitmap::Config config, SkBitmap* bitmap) { - bitmap->allocConfigPixels(config, SLIDE_SIZE, SLIDE_SIZE); +static void init_bitmap(SkColorType ct, SkBitmap* bitmap) { + bitmap->allocPixels(SkImageInfo::Make(SLIDE_SIZE, SLIDE_SIZE, ct, + kPremul_SkAlphaType)); bitmap->eraseColor(SK_ColorWHITE); } static SkBitmap make_argb8888_gradient() { SkBitmap bitmap; - init_bitmap(SkBitmap::kARGB_8888_Config, &bitmap); + init_bitmap(kPMColor_SkColorType, &bitmap); uint8_t rowColor = 0; for (int y = 0; y < SLIDE_SIZE; y++) { uint32_t* dst = bitmap.getAddr32(0, y); @@ -46,7 +47,7 @@ static SkBitmap make_argb8888_gradient() { static SkBitmap make_argb4444_gradient() { SkBitmap bitmap; - init_bitmap(SkBitmap::kARGB_4444_Config, &bitmap); + init_bitmap(kARGB_4444_SkColorType, &bitmap); uint8_t rowColor = 0; for (int y = 0; y < SLIDE_SIZE; y++) { uint16_t* dst = bitmap.getAddr16(0, y); @@ -63,7 +64,7 @@ static SkBitmap make_argb4444_gradient() { static SkBitmap make_argb8888_stripes() { SkBitmap bitmap; - init_bitmap(SkBitmap::kARGB_8888_Config, &bitmap); + init_bitmap(kPMColor_SkColorType, &bitmap); uint8_t rowColor = 0; for (int y = 0; y < SLIDE_SIZE; y++) { uint32_t* dst = bitmap.getAddr32(0, y); @@ -82,7 +83,7 @@ static SkBitmap make_argb8888_stripes() { static SkBitmap make_argb4444_stripes() { SkBitmap bitmap; - init_bitmap(SkBitmap::kARGB_4444_Config, &bitmap); + init_bitmap(kARGB_4444_SkColorType, &bitmap); uint8_t rowColor = 0;; for (int y = 0; y < SLIDE_SIZE; y++) { uint16_t* dst = bitmap.getAddr16(0, y); |