Update all callsites to use info for pixelrefs

#define SK_SUPPORT_LEGACY_PIXELREF_CONSTRUCTOR in chrome to keep old API signature (for now)

BUG=
R=scroggo@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12677 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index bb05432..448c18f 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -149,6 +149,7 @@
     REPORTER_ASSERT(reporter, SkAlign4(bytesWritten) == bytesWritten);
 
     unsigned char dataWritten[1024];
+    SkASSERT(bytesWritten <= sizeof(dataWritten));
     writer.writeToMemory(dataWritten);
 
     // Make sure this fails when it should (test with smaller size, but still multiple of 4)
@@ -308,10 +309,22 @@
         TestBitmapSerialization(validBitmap, invalidBitmap, true, reporter);
 
         // Create a bitmap with a pixel ref too small
+        SkImageInfo info;
+        info.fWidth = 256;
+        info.fHeight = 256;
+        info.fColorType = kPMColor_SkColorType;
+        info.fAlphaType = kPremul_SkAlphaType;
+
         SkBitmap invalidBitmap2;
-        invalidBitmap2.setConfig(SkBitmap::kARGB_8888_Config, 256, 256);
-        invalidBitmap2.setPixelRef(SkNEW_ARGS(SkMallocPixelRef,
-            (NULL, 256, NULL)))->unref();
+        invalidBitmap2.setConfig(info);
+        
+        // Hack to force invalid, by making the pixelref smaller than its
+        // owning bitmap.
+        info.fWidth = 32;
+        info.fHeight = 1;
+        
+        invalidBitmap2.setPixelRef(SkMallocPixelRef::NewAllocate(
+                        info, invalidBitmap2.rowBytes(), NULL))->unref();
 
         // The deserialization should detect the pixel ref being too small and fail
         TestBitmapSerialization(validBitmap, invalidBitmap2, false, reporter);