Index: src/image/SkImage.cpp |
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp |
index 1c1b311b9381cda6966bf6ca2f3880655a45ef0e..88cf779081bf47ed4d10619904db6472c6a74d72 100644 |
--- a/src/image/SkImage.cpp |
+++ b/src/image/SkImage.cpp |
@@ -319,8 +319,8 @@ bool SkImage::asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const { |
bool SkImage_Base::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const { |
// As the base-class, all we can do is make a copy (regardless of mode). |
// Subclasses that want to be more optimal should override. |
- SkImageInfo info = SkImageInfo::MakeN32(this->width(), this->height(), |
- this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType); |
+ SkImageInfo info = this->onImageInfo().makeColorType(kN32_SkColorType) |
+ .makeAlphaType(this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType); |
if (!bitmap->tryAllocPixels(info)) { |
return false; |
} |