add legacy/helper allocN32Pixels, and convert gm to use it
This is an intermediate api, but might help us quickly get to a point where
no one is creating bitmaps in a 2-step process (setConfig + alloc).
BUG=skia:
R=halcanary@google.com
Review URL: https://codereview.chromium.org/140593005
git-svn-id: http://skia.googlecode.com/svn/trunk@13182 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/tablecolorfilter.cpp b/gm/tablecolorfilter.cpp
index 49e342d..f806caa 100644
--- a/gm/tablecolorfilter.cpp
+++ b/gm/tablecolorfilter.cpp
@@ -13,8 +13,7 @@
static void make_bm0(SkBitmap* bm) {
int W = 120;
int H = 120;
- bm->setConfig(SkBitmap::kARGB_8888_Config, W, H);
- bm->allocPixels();
+ bm->allocN32Pixels(W, H);
bm->eraseColor(SK_ColorTRANSPARENT);
SkCanvas canvas(*bm);
@@ -32,8 +31,7 @@
static void make_bm1(SkBitmap* bm) {
int W = 120;
int H = 120;
- bm->setConfig(SkBitmap::kARGB_8888_Config, W, H);
- bm->allocPixels();
+ bm->allocN32Pixels(W, H);
bm->eraseColor(SK_ColorTRANSPARENT);
SkCanvas canvas(*bm);