Disable the WIC encoder for jpegs
My fix from https://codereview.chromium.org/1791583002/ is not sufficient. WIC will only encode JPEGs if we pass in a bitmap in BGR format. For now, let's disable the WIC encoder on JPEGs and fall back on SkImageEncoder_libjpeg. This should fix the scaled-generator gm. https://gold.skia.org/search2?query=source_type%3Dgm%26name%3Dscale-generator&include=false&head=true&unt=true&pos=false&neg=false&limit=100 BUG=skia:3969 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1823743002 Review URL: https://codereview.chromium.org/1823743002
This commit is contained in:
parent
7b380d0d0e
commit
60316a9ec4
@ -411,6 +411,10 @@ bool SkImageEncoder_WIC::onEncode(SkWStream* stream
|
|||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
hr = piBitmapFrameEncode->SetPixelFormat(&formatGUID);
|
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.
|
//Write the pixels into the frame.
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
@ -440,7 +444,6 @@ static SkImageEncoder* sk_imageencoder_wic_factory(SkImageEncoder::Type t) {
|
|||||||
switch (t) {
|
switch (t) {
|
||||||
case SkImageEncoder::kBMP_Type:
|
case SkImageEncoder::kBMP_Type:
|
||||||
case SkImageEncoder::kICO_Type:
|
case SkImageEncoder::kICO_Type:
|
||||||
case SkImageEncoder::kJPEG_Type:
|
|
||||||
case SkImageEncoder::kPNG_Type:
|
case SkImageEncoder::kPNG_Type:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user