Skip to content

Commit

Permalink
Use OffscreenCanvas as intended for all code-paths in `src/display/…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Snuffleupagus committed Feb 24, 2023
1 parent 9c58d4f commit 5075d04
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/display/text_layer.js
Expand Up @@ -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;
Expand Down

0 comments on commit 5075d04

Please sign in to comment.