Index: src/ports/SkImageDecoder_WIC.cpp |
diff --git a/src/ports/SkImageDecoder_WIC.cpp b/src/ports/SkImageDecoder_WIC.cpp |
index fa408836a4a4c09f71d3389ea1121b9d3f653cc8..c7222e635a993f97f5e07ee0bc140f64b1864f5b 100644 |
--- a/src/ports/SkImageDecoder_WIC.cpp |
+++ b/src/ports/SkImageDecoder_WIC.cpp |
@@ -404,16 +404,13 @@ bool SkImageEncoder_WIC::onEncode(SkWStream* stream |
hr = piBitmapFrameEncode->SetSize(width, height); |
} |
- //Set the pixel format of the frame. |
+ //Set the pixel format of the frame. If native encoded format cannot match BGRA, |
+ //it will choose the closest pixel format that it supports. |
const WICPixelFormatGUID formatDesired = GUID_WICPixelFormat32bppBGRA; |
WICPixelFormatGUID formatGUID = formatDesired; |
if (SUCCEEDED(hr)) { |
hr = piBitmapFrameEncode->SetPixelFormat(&formatGUID); |
} |
- if (SUCCEEDED(hr)) { |
- //Be sure the image format is the one requested. |
- hr = IsEqualGUID(formatGUID, formatDesired) ? S_OK : E_FAIL; |
- } |
//Write the pixels into the frame. |
if (SUCCEEDED(hr)) { |