From cff9ab7d9804804f0805b59ca5712f70b2d93bb2 Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Fri, 12 Jan 2018 11:09:54 -0500 Subject: Bitmap: clearing pixelref keeps rowbytes Change-Id: Ibf8b69adcb4e9df597079a8d9ada75b4a31194e6 Reviewed-on: https://skia-review.googlesource.com/94040 Reviewed-by: Mike Reed Commit-Queue: Hal Canary --- tests/BitmapTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/BitmapTest.cpp') diff --git a/tests/BitmapTest.cpp b/tests/BitmapTest.cpp index ddc770f99d..f62288cd22 100644 --- a/tests/BitmapTest.cpp +++ b/tests/BitmapTest.cpp @@ -218,3 +218,11 @@ DEF_TEST(Bitmap_erase_f16_erase_getColor, r) { } } +// Make sure that the bitmap remains valid when pixelref is removed. +DEF_TEST(Bitmap_clear_pixelref_keep_info, r) { + SkBitmap bm; + bm.allocPixels(SkImageInfo::MakeN32Premul(100,100)); + bm.setPixelRef(nullptr, 0, 0); + SkDEBUGCODE(bm.validate();) +} + -- cgit v1.2.3