Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1090)

Unified Diff: tests/DrawBitmapRectTest.cpp

Issue 68973005: Expand pixelref to return SkImageInfo and rowbytes (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: new convention: require SkImageInfo in constructor Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698