Remove the enableHWA option from viewer components (PR 20016 follow-up)

In PR 20016 the actual uses of the `enableHWA` option was removed from the viewer, but for some reason it's still being provided when initializing `PDFViewer` and `PDFThumbnailViewer` despite the fact that it's now dead code.
This commit is contained in:
Jonas Jenwald 2026-03-11 15:22:55 +01:00
parent 79df166e06
commit 63b4874b39
4 changed files with 2 additions and 16 deletions

View File

@ -535,8 +535,7 @@ const PDFViewerApplication = {
) )
: null; : null;
const enableHWA = AppOptions.get("enableHWA"), const maxCanvasPixels = AppOptions.get("maxCanvasPixels"),
maxCanvasPixels = AppOptions.get("maxCanvasPixels"),
maxCanvasDim = AppOptions.get("maxCanvasDim"), maxCanvasDim = AppOptions.get("maxCanvasDim"),
capCanvasAreaFactor = AppOptions.get("capCanvasAreaFactor"); capCanvasAreaFactor = AppOptions.get("capCanvasAreaFactor");
const pdfViewer = (this.pdfViewer = new PDFViewer({ const pdfViewer = (this.pdfViewer = new PDFViewer({
@ -580,7 +579,6 @@ const PDFViewerApplication = {
pageColors, pageColors,
mlManager, mlManager,
abortSignal, abortSignal,
enableHWA,
supportsPinchToZoom: this.supportsPinchToZoom, supportsPinchToZoom: this.supportsPinchToZoom,
enableAutoLinking: AppOptions.get("enableAutoLinking"), enableAutoLinking: AppOptions.get("enableAutoLinking"),
minDurationToUpdateCanvas: AppOptions.get("minDurationToUpdateCanvas"), minDurationToUpdateCanvas: AppOptions.get("minDurationToUpdateCanvas"),
@ -601,7 +599,6 @@ const PDFViewerApplication = {
maxCanvasDim, maxCanvasDim,
pageColors, pageColors,
abortSignal, abortSignal,
enableHWA,
enableSplitMerge, enableSplitMerge,
statusBar: viewsManager.viewsManagerStatusBar, statusBar: viewsManager.viewsManagerStatusBar,
undoBar: viewsManager.viewsManagerUndoBar, undoBar: viewsManager.viewsManagerUndoBar,

View File

@ -453,7 +453,7 @@ const defaultOptions = {
enableHWA: { enableHWA: {
/** @type {boolean} */ /** @type {boolean} */
value: typeof PDFJSDev !== "undefined" && !PDFJSDev.test("MOZCENTRAL"), value: typeof PDFJSDev !== "undefined" && !PDFJSDev.test("MOZCENTRAL"),
kind: OptionKind.API + OptionKind.VIEWER + OptionKind.PREFERENCE, kind: OptionKind.API + OptionKind.PREFERENCE,
}, },
enableXfa: { enableXfa: {
/** @type {boolean} */ /** @type {boolean} */

View File

@ -64,8 +64,6 @@ const SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT = 15;
* mode. * mode.
* @property {AbortSignal} [abortSignal] - The AbortSignal for the window * @property {AbortSignal} [abortSignal] - The AbortSignal for the window
* events. * events.
* @property {boolean} [enableHWA] - Enables hardware acceleration for
* rendering. The default value is `false`.
* @property {boolean} [enableSplitMerge] - Enables split and merge features. * @property {boolean} [enableSplitMerge] - Enables split and merge features.
* The default value is `false`. * The default value is `false`.
* @property {Object} [statusBar] - The status bar elements to manage the status * @property {Object} [statusBar] - The status bar elements to manage the status
@ -173,7 +171,6 @@ class PDFThumbnailViewer {
maxCanvasDim, maxCanvasDim,
pageColors, pageColors,
abortSignal, abortSignal,
enableHWA,
enableSplitMerge, enableSplitMerge,
statusBar, statusBar,
undoBar, undoBar,
@ -188,7 +185,6 @@ class PDFThumbnailViewer {
this.maxCanvasPixels = maxCanvasPixels; this.maxCanvasPixels = maxCanvasPixels;
this.maxCanvasDim = maxCanvasDim; this.maxCanvasDim = maxCanvasDim;
this.pageColors = pageColors || null; this.pageColors = pageColors || null;
this.enableHWA = enableHWA || false;
this.#enableSplitMerge = enableSplitMerge || false; this.#enableSplitMerge = enableSplitMerge || false;
this.#statusLabel = statusBar?.viewsManagerStatusActionLabel || null; this.#statusLabel = statusBar?.viewsManagerStatusActionLabel || null;
this.#statusBar = statusBar?.viewsManagerStatusAction || null; this.#statusBar = statusBar?.viewsManagerStatusAction || null;
@ -415,7 +411,6 @@ class PDFThumbnailViewer {
maxCanvasPixels: this.maxCanvasPixels, maxCanvasPixels: this.maxCanvasPixels,
maxCanvasDim: this.maxCanvasDim, maxCanvasDim: this.maxCanvasDim,
pageColors: this.pageColors, pageColors: this.pageColors,
enableHWA: this.enableHWA,
enableSplitMerge: this.#enableSplitMerge, enableSplitMerge: this.#enableSplitMerge,
}); });
this._thumbnails.push(thumbnail); this._thumbnails.push(thumbnail);

View File

@ -145,8 +145,6 @@ function isValidAnnotationEditorMode(mode) {
* @property {Object} [pageColors] - Overwrites background and foreground colors * @property {Object} [pageColors] - Overwrites background and foreground colors
* with user defined ones in order to improve readability in high contrast * with user defined ones in order to improve readability in high contrast
* mode. * mode.
* @property {boolean} [enableHWA] - Enables hardware acceleration for
* rendering. The default value is `false`.
* @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture. * @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture.
* The default value is `true`. * The default value is `true`.
* @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from * @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from
@ -245,8 +243,6 @@ class PDFViewer {
#editorUndoBar = null; #editorUndoBar = null;
#enableHWA = false;
#enableHighlightFloatingButton = false; #enableHighlightFloatingButton = false;
#enablePermissions = false; #enablePermissions = false;
@ -372,7 +368,6 @@ class PDFViewer {
this.#enablePermissions = options.enablePermissions || false; this.#enablePermissions = options.enablePermissions || false;
this.pageColors = options.pageColors || null; this.pageColors = options.pageColors || null;
this.#mlManager = options.mlManager || null; this.#mlManager = options.mlManager || null;
this.#enableHWA = options.enableHWA || false;
this.#supportsPinchToZoom = options.supportsPinchToZoom !== false; this.#supportsPinchToZoom = options.supportsPinchToZoom !== false;
this.#enableAutoLinking = options.enableAutoLinking !== false; this.#enableAutoLinking = options.enableAutoLinking !== false;
this.#minDurationToUpdateCanvas = options.minDurationToUpdateCanvas ?? 500; this.#minDurationToUpdateCanvas = options.minDurationToUpdateCanvas ?? 500;
@ -1070,7 +1065,6 @@ class PDFViewer {
pageColors, pageColors,
l10n: this.l10n, l10n: this.l10n,
layerProperties: this._layerProperties, layerProperties: this._layerProperties,
enableHWA: this.#enableHWA,
enableAutoLinking: this.#enableAutoLinking, enableAutoLinking: this.#enableAutoLinking,
minDurationToUpdateCanvas: this.#minDurationToUpdateCanvas, minDurationToUpdateCanvas: this.#minDurationToUpdateCanvas,
commentManager: this.#commentManager, commentManager: this.#commentManager,