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/mixedxfermodes.cpp b/gm/mixedxfermodes.cpp
index e3ce91a..4562325 100644
--- a/gm/mixedxfermodes.cpp
+++ b/gm/mixedxfermodes.cpp
@@ -84,11 +84,8 @@
0xFFCCCCCC,
0xFFFFFFFF };
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, 2, 2, 2 * sizeof(uint32_t));
- bitmap.allocPixels();
- bitmap.lockPixels();
+ bitmap.allocN32Pixels(2, 2);
memcpy(bitmap.getPixels(), kCheckerPixelData, sizeof(kCheckerPixelData));
- bitmap.unlockPixels();
fBG.reset(SkShader::CreateBitmapShader(bitmap,
SkShader::kRepeat_TileMode,
SkShader::kRepeat_TileMode));