Index: tests/SerializationTest.cpp |
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp |
index f1d0f900fd0eca09f187017b1b246e251f651635..7ae06d737e4f7643aa7e56abe06a01850ca8eb14 100644 |
--- a/tests/SerializationTest.cpp |
+++ b/tests/SerializationTest.cpp |
@@ -148,7 +148,6 @@ static T* TestFlattenableSerialization(T* testObj, bool shouldSucceed, |
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,22 +307,10 @@ static void Tests(skiatest::Reporter* reporter) { |
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(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(); |
+ invalidBitmap2.setConfig(SkBitmap::kARGB_8888_Config, 256, 256); |
+ invalidBitmap2.setPixelRef(SkNEW_ARGS(SkMallocPixelRef, |
+ (NULL, 256, NULL)))->unref(); |
// The deserialization should detect the pixel ref being too small and fail |
TestBitmapSerialization(validBitmap, invalidBitmap2, false, reporter); |