replace setConfig+allocPixels with alloc-or-install-pixels

BUG=skia:
R=scroggo@google.com, halcanary@google.com, reed@google.com

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/164203003

git-svn-id: http://skia.googlecode.com/svn/trunk@13442 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index f1c3592..7c441a4 100644
--- a/tests/CanvasStateTest.cpp
+++ b/tests/CanvasStateTest.cpp
@@ -24,10 +24,10 @@
                                    SkIntToScalar(WIDTH-(2*SPACER)),
                                    SkIntToScalar((HEIGHT-(2*SPACER)) / 7));
 
-    const SkBitmap::Config configs[] = { SkBitmap::kRGB_565_Config,
-                                         SkBitmap::kARGB_8888_Config
+    const SkColorType colorTypes[] = {
+        kRGB_565_SkColorType, kPMColor_SkColorType
     };
-    const int configCount = sizeof(configs) / sizeof(SkBitmap::Config);
+    const int configCount = sizeof(colorTypes) / sizeof(SkBitmap::Config);
 
     const int layerAlpha[] = { 255, 255, 0 };
     const SkCanvas::SaveFlags flags[] = { SkCanvas::kARGB_NoClipLayer_SaveFlag,
@@ -40,8 +40,9 @@
     for (int i = 0; i < configCount; ++i) {
         SkBitmap bitmaps[2];
         for (int j = 0; j < 2; ++j) {
-            bitmaps[j].setConfig(configs[i], WIDTH, HEIGHT);
-            bitmaps[j].allocPixels();
+            bitmaps[j].allocPixels(SkImageInfo::Make(WIDTH, HEIGHT,
+                                                     colorTypes[i],
+                                                     kPremul_SkAlphaType));
 
             SkCanvas canvas(bitmaps[j]);
 
@@ -127,8 +128,7 @@
 
     SkBitmap bitmaps[2];
     for (int i = 0; i < 2; ++i) {
-        bitmaps[i].setConfig(SkBitmap::kARGB_8888_Config, WIDTH, HEIGHT);
-        bitmaps[i].allocPixels();
+        bitmaps[i].allocN32Pixels(WIDTH, HEIGHT);
 
         SkCanvas canvas(bitmaps[i]);