[impeller] always copy bitmaps when given unencoded data (flutter/engine#40543)

[impeller] always copy bitmaps when given unencoded data
This commit is contained in:
Jonah Williams
2023-03-22 17:54:01 -07:00
committed by GitHub
parent 401e110a66
commit 7b228c8b4b

View File

@@ -193,11 +193,6 @@ std::optional<DecompressResult> ImageDecoderImpeller::DecompressTexture(
FML_DLOG(ERROR) << "Could not decompress image.";
return std::nullopt;
}
} else if (image_info.colorType() == base_image_info.colorType()) {
auto pixel_ref = SkMallocPixelRef::MakeWithData(
image_info, descriptor->row_bytes(), descriptor->data());
bitmap->setPixelRef(pixel_ref, 0, 0);
bitmap->setImmutable();
} else {
auto temp_bitmap = std::make_shared<SkBitmap>();
temp_bitmap->setInfo(base_image_info);