aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/BitmapTest.cpp
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2018-01-12 11:09:54 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-12 19:15:49 +0000
commitcff9ab7d9804804f0805b59ca5712f70b2d93bb2 (patch)
tree4a0d6a6116a13a87977ea755d84d570ff94e8222 /tests/BitmapTest.cpp
parent620c0b63784133c7f853f2c69b66f3dd36936574 (diff)
Bitmap: clearing pixelref keeps rowbytes
Change-Id: Ibf8b69adcb4e9df597079a8d9ada75b4a31194e6 Reviewed-on: https://skia-review.googlesource.com/94040 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tests/BitmapTest.cpp')
-rw-r--r--tests/BitmapTest.cpp8
1 files changed, 8 insertions, 0 deletions
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();)
+}
+