From 5075d0495b422b8f0245bb10dad355899672d8d7 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 24 Feb 2023 11:29:58 +0100 Subject: [PATCH] Use `OffscreenCanvas` as intended for all code-paths in `src/display/text_layer.js` (PR 15722 follow-up) Currently some `getCtx` calls will have `isOffscreenCanvasSupported === undefined` set, meaning that `OffscreenCanvas` isn't being used as intended, since no `TextLayerRenderTask._isOffscreenCanvasSupported` property exists. *Please note:* This patch is written using the GitHub UI, since I'm currently without a dev machine, so hopefully it works correctly. --- src/display/text_layer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/display/text_layer.js b/src/display/text_layer.js index 9d596f645..92fa54801 100644 --- a/src/display/text_layer.js +++ b/src/display/text_layer.js @@ -311,6 +311,7 @@ class TextLayerRenderTask { this._container = this._rootContainer = container; this._textDivs = textDivs || []; this._textContentItemsStr = textContentItemsStr || []; + this._isOffscreenCanvasSupported = isOffscreenCanvasSupported; this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled; this._reader = null;