Skip to content

Commit 63b4874

Browse files
committed
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.
1 parent 79df166 commit 63b4874

4 files changed

Lines changed: 2 additions & 16 deletions

File tree

web/app.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,7 @@ const PDFViewerApplication = {
535535
)
536536
: null;
537537

538-
const enableHWA = AppOptions.get("enableHWA"),
539-
maxCanvasPixels = AppOptions.get("maxCanvasPixels"),
538+
const maxCanvasPixels = AppOptions.get("maxCanvasPixels"),
540539
maxCanvasDim = AppOptions.get("maxCanvasDim"),
541540
capCanvasAreaFactor = AppOptions.get("capCanvasAreaFactor");
542541
const pdfViewer = (this.pdfViewer = new PDFViewer({
@@ -580,7 +579,6 @@ const PDFViewerApplication = {
580579
pageColors,
581580
mlManager,
582581
abortSignal,
583-
enableHWA,
584582
supportsPinchToZoom: this.supportsPinchToZoom,
585583
enableAutoLinking: AppOptions.get("enableAutoLinking"),
586584
minDurationToUpdateCanvas: AppOptions.get("minDurationToUpdateCanvas"),
@@ -601,7 +599,6 @@ const PDFViewerApplication = {
601599
maxCanvasDim,
602600
pageColors,
603601
abortSignal,
604-
enableHWA,
605602
enableSplitMerge,
606603
statusBar: viewsManager.viewsManagerStatusBar,
607604
undoBar: viewsManager.viewsManagerUndoBar,

web/app_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ const defaultOptions = {
453453
enableHWA: {
454454
/** @type {boolean} */
455455
value: typeof PDFJSDev !== "undefined" && !PDFJSDev.test("MOZCENTRAL"),
456-
kind: OptionKind.API + OptionKind.VIEWER + OptionKind.PREFERENCE,
456+
kind: OptionKind.API + OptionKind.PREFERENCE,
457457
},
458458
enableXfa: {
459459
/** @type {boolean} */

web/pdf_thumbnail_viewer.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ const SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT = 15;
6464
* mode.
6565
* @property {AbortSignal} [abortSignal] - The AbortSignal for the window
6666
* events.
67-
* @property {boolean} [enableHWA] - Enables hardware acceleration for
68-
* rendering. The default value is `false`.
6967
* @property {boolean} [enableSplitMerge] - Enables split and merge features.
7068
* The default value is `false`.
7169
* @property {Object} [statusBar] - The status bar elements to manage the status
@@ -173,7 +171,6 @@ class PDFThumbnailViewer {
173171
maxCanvasDim,
174172
pageColors,
175173
abortSignal,
176-
enableHWA,
177174
enableSplitMerge,
178175
statusBar,
179176
undoBar,
@@ -188,7 +185,6 @@ class PDFThumbnailViewer {
188185
this.maxCanvasPixels = maxCanvasPixels;
189186
this.maxCanvasDim = maxCanvasDim;
190187
this.pageColors = pageColors || null;
191-
this.enableHWA = enableHWA || false;
192188
this.#enableSplitMerge = enableSplitMerge || false;
193189
this.#statusLabel = statusBar?.viewsManagerStatusActionLabel || null;
194190
this.#statusBar = statusBar?.viewsManagerStatusAction || null;
@@ -415,7 +411,6 @@ class PDFThumbnailViewer {
415411
maxCanvasPixels: this.maxCanvasPixels,
416412
maxCanvasDim: this.maxCanvasDim,
417413
pageColors: this.pageColors,
418-
enableHWA: this.enableHWA,
419414
enableSplitMerge: this.#enableSplitMerge,
420415
});
421416
this._thumbnails.push(thumbnail);

web/pdf_viewer.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ function isValidAnnotationEditorMode(mode) {
145145
* @property {Object} [pageColors] - Overwrites background and foreground colors
146146
* with user defined ones in order to improve readability in high contrast
147147
* mode.
148-
* @property {boolean} [enableHWA] - Enables hardware acceleration for
149-
* rendering. The default value is `false`.
150148
* @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture.
151149
* The default value is `true`.
152150
* @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from
@@ -245,8 +243,6 @@ class PDFViewer {
245243

246244
#editorUndoBar = null;
247245

248-
#enableHWA = false;
249-
250246
#enableHighlightFloatingButton = false;
251247

252248
#enablePermissions = false;
@@ -372,7 +368,6 @@ class PDFViewer {
372368
this.#enablePermissions = options.enablePermissions || false;
373369
this.pageColors = options.pageColors || null;
374370
this.#mlManager = options.mlManager || null;
375-
this.#enableHWA = options.enableHWA || false;
376371
this.#supportsPinchToZoom = options.supportsPinchToZoom !== false;
377372
this.#enableAutoLinking = options.enableAutoLinking !== false;
378373
this.#minDurationToUpdateCanvas = options.minDurationToUpdateCanvas ?? 500;
@@ -1070,7 +1065,6 @@ class PDFViewer {
10701065
pageColors,
10711066
l10n: this.l10n,
10721067
layerProperties: this._layerProperties,
1073-
enableHWA: this.#enableHWA,
10741068
enableAutoLinking: this.#enableAutoLinking,
10751069
minDurationToUpdateCanvas: this.#minDurationToUpdateCanvas,
10761070
commentManager: this.#commentManager,

0 commit comments

Comments
 (0)