Remove web codecs usage

It was decoding transparency incorrectly (multiplication wrong?), and I'd rather not have a different code path there for the sake of it
This commit is contained in:
jakearchibald
2022-12-15 14:56:51 +00:00
parent 97d13de273
commit 42594277fd
5 changed files with 6 additions and 127 deletions

View File

@@ -10,8 +10,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as WebCodecs from '../util/web-codecs';
import { drawableToImageData } from './canvas';
/** If render engine is Safari */
@@ -139,15 +137,7 @@ export async function blobToImg(blob: Blob): Promise<HTMLImageElement> {
export async function builtinDecode(
signal: AbortSignal,
blob: Blob,
mimeType: string,
): Promise<ImageData> {
// If WebCodecs are supported, use that.
if (await WebCodecs.isTypeSupported(mimeType)) {
assertSignal(signal);
try {
return await abortable(signal, WebCodecs.decode(blob, mimeType));
} catch (e) {}
}
assertSignal(signal);
// Prefer createImageBitmap as it's the off-thread option for Firefox.