Index: src/core/SkBitmapDevice.cpp |
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp |
index 311e72f576820b18966549d9d372ca62a733ae90..76553ef1416c9813fefc6799ff19f52ea1e6b112 100644 |
--- a/src/core/SkBitmapDevice.cpp |
+++ b/src/core/SkBitmapDevice.cpp |
@@ -440,7 +440,11 @@ SkSurface* SkBitmapDevice::newSurface(const SkImageInfo& info) { |
} |
const void* SkBitmapDevice::peekPixels(SkImageInfo* info, size_t* rowBytes) { |
- if (fBitmap.getPixels() && fBitmap.asImageInfo(info)) { |
+ const SkImageInfo bmInfo = fBitmap.info(); |
+ if (fBitmap.getPixels() && (kUnknown_SkColorType != bmInfo.colorType())) { |
+ if (info) { |
+ *info = bmInfo; |
+ } |
if (rowBytes) { |
*rowBytes = fBitmap.rowBytes(); |
} |