(src)
| 3450 | const _oledTextCtx = _oledTextCanvas.getContext("2d", { willReadFrequently: true }); |
| 3451 | |
| 3452 | function getCachedOledImage(src) { |
| 3453 | const key = String(src || ""); |
| 3454 | if (!key) return null; |
| 3455 | if (_oledImageCache.has(key)) return _oledImageCache.get(key); |
| 3456 | const img = new Image(); |
| 3457 | img.crossOrigin = "anonymous"; |
| 3458 | img.onload = () => { |
| 3459 | try { renderElements(); } catch (_) {} |
| 3460 | }; |
| 3461 | img.src = key; |
| 3462 | _oledImageCache.set(key, img); |
| 3463 | return img; |
| 3464 | } |
| 3465 | |
| 3466 | function drawOledIconAlphaMask(ctx, src, x, y, w, h, color) { |
| 3467 | const img = getCachedOledImage(src); |
no test coverage detected