diff --git a/engine/src/flutter/lib/ui/painting/image_encoding.cc b/engine/src/flutter/lib/ui/painting/image_encoding.cc index 6db7fcf679..c32c06cc2d 100644 --- a/engine/src/flutter/lib/ui/painting/image_encoding.cc +++ b/engine/src/flutter/lib/ui/painting/image_encoding.cc @@ -86,9 +86,10 @@ sk_sp EncodeImage(sk_sp image, ImageByteFormat format) { if (pixmap.colorType() != kRGBA_8888_SkColorType) { TRACE_EVENT0("flutter", "ConvertToRGBA"); - // Convert the pixel data to N32 to adhere to our API contract. - const auto image_info = SkImageInfo::MakeN32Premul(image->width(), - image->height()); + // Convert the pixel data to N32 and RGBA to adhere to our API contract. + const auto image_info = SkImageInfo::MakeN32Premul( + image->width(), image->height()).makeColorType(kRGBA_8888_SkColorType); + auto surface = SkSurface::MakeRaster(image_info); surface->writePixels(pixmap, 0, 0); if (!surface->peekPixels(&pixmap)) {