Chromium Code Reviews| Index: src/android/SkBitmapRegionCodec.cpp |
| diff --git a/src/android/SkBitmapRegionCodec.cpp b/src/android/SkBitmapRegionCodec.cpp |
| index b9c82d941afc56aa5efbf2263b4db8f101ea06f1..a335432b31a0d03d473b7647168aac123c42228c 100644 |
| --- a/src/android/SkBitmapRegionCodec.cpp |
| +++ b/src/android/SkBitmapRegionCodec.cpp |
| @@ -52,8 +52,9 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat |
| // Create the image info for the decode |
| SkColorType dstColorType = fCodec->computeOutputColorType(prefColorType); |
| SkAlphaType dstAlphaType = fCodec->computeOutputAlphaType(requireUnpremul); |
| - SkImageInfo decodeInfo = SkImageInfo::Make(scaledSize.width(), scaledSize.height(), |
| - dstColorType, dstAlphaType); |
| + SkImageInfo decodeInfo = fCodec->getInfo().makeWH(scaledSize.width(), scaledSize.height()) |
| + .makeColorType(dstColorType) |
| + .makeAlphaType(dstAlphaType); |
| // Construct a color table for the decode if necessary |
| SkAutoTUnref<SkColorTable> colorTable(nullptr); |
| @@ -85,7 +86,7 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat |
| // used kAlpha8 for grayscale images (before kGray8 existed). While |
| // the codec recognizes kGray8, we need to decode into a kAlpha8 |
| // bitmap in order to avoid a behavior change. |
| - outInfo = SkImageInfo::MakeA8(scaledOutWidth, scaledOutHeight); |
| + outInfo = outInfo.makeColorType(kAlpha_8_SkColorType).makeAlphaType(kPremul_SkAlphaType); |
| } |
| bitmap->setInfo(outInfo); |
| if (!bitmap->tryAllocPixels(allocator, colorTable.get())) { |
| @@ -131,8 +132,5 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat |
| } |
| bool SkBitmapRegionCodec::conversionSupported(SkColorType colorType) { |
| - // FIXME: Call virtual function when it lands. |
| - SkImageInfo info = SkImageInfo::Make(0, 0, colorType, fCodec->getInfo().alphaType(), |
| - fCodec->getInfo().profileType()); |
| - return conversion_possible(info, fCodec->getInfo()); |
| + return conversion_possible(fCodec->getInfo().makeColorType(colorType), fCodec->getInfo()); |
|
scroggo
2016/06/03 15:01:59
I suppose we'll need to (eventually) update conver
msarett
2016/06/03 15:08:32
Not quite sure if this change will matter or not.
|
| } |