use possible corrected info when creating pixelref
TBR=halcanary, scroggo
Author: reed@google.com
Review URL: https://codereview.chromium.org/518103002
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index ce38a4a..a86c3de 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -105,7 +105,10 @@
|| (!dst->setInfo(info))) {
return false;
}
- SkASSERT(dst->colorType() != kUnknown_SkColorType);
+ // Since dst->setInfo() may have changed/fixed-up info, we copy it back from that bitmap
+ info = dst->info();
+
+ SkASSERT(info.colorType() != kUnknown_SkColorType);
if (dst->empty()) { // Use a normal pixelref.
return dst->allocPixels();
}