| Index: tests/DrawBitmapRectTest.cpp
|
| diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
|
| index 4c6d634eb0bb7d5810b9611df762e2598f3f2710..3b5ac15d0f9660814ef6e726ea0c0f3a5115e1e8 100644
|
| --- a/tests/DrawBitmapRectTest.cpp
|
| +++ b/tests/DrawBitmapRectTest.cpp
|
| @@ -35,14 +35,20 @@ static bool FailureDecoder(const void* data, size_t length, SkImageInfo* info,
|
| // Crashing in skia when a pixelref fails in lockPixels
|
| //
|
| static void test_faulty_pixelref(skiatest::Reporter* reporter) {
|
| + SkImageInfo info;
|
| + info.fWidth = 100;
|
| + info.fHeight = 100;
|
| + info.fColorType = kPMColor_SkColorType;
|
| + info.fAlphaType = kPremul_SkAlphaType;
|
| +
|
| // need a cache, but don't expect to use it, so the budget is not critical
|
| SkLruImageCache cache(10 * 1000);
|
| // construct a garbage data represent "bad" encoded data.
|
| SkAutoDataUnref data(SkData::NewFromMalloc(malloc(1000), 1000));
|
| - SkAutoTUnref<SkPixelRef> pr(new SkLazyPixelRef(data, FailureDecoder, &cache));
|
| + SkAutoTUnref<SkPixelRef> pr(new SkLazyPixelRef(info, data, FailureDecoder, &cache));
|
|
|
| SkBitmap bm;
|
| - bm.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
|
| + bm.setConfig(info);
|
| bm.setPixelRef(pr);
|
| // now our bitmap has a pixelref, but we know it will fail to lock
|
|
|
|
|