Re-factor the isLittleEndian/isEvalSupported caching

This functionality is very old, hence we should be able to improve the caching a little bit with modern JavaScript features.
This commit is contained in:
Jonas Jenwald 2022-04-05 16:01:01 +02:00
parent 27e738dff9
commit 1dc4713a0b
4 changed files with 17 additions and 18 deletions

View file

@ -14,11 +14,11 @@
*/
import {
FeatureTest,
FONT_IDENTITY_MATRIX,
IDENTITY_MATRIX,
ImageKind,
info,
IsLittleEndianCached,
OPS,
shadow,
TextRenderingMode,
@ -702,7 +702,7 @@ function putBinaryImageData(ctx, imgData, transferMaps = null) {
const dest32DataLength = dest32.length;
const fullSrcDiff = (width + 7) >> 3;
let white = 0xffffffff;
let black = IsLittleEndianCached.value ? 0xff000000 : 0x000000ff;
let black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;
if (transferMapGray) {
if (transferMapGray[0] === 0xff && transferMapGray[0xff] === 0) {