diff options
Diffstat (limited to 'src/image/SkImage.cpp')
-rw-r--r-- | src/image/SkImage.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp index 1c1b311b93..88cf779081 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; } |