Add an option to enable/disable hardware acceleration (bug 1902012)

This commit is contained in:
Calixte Denizet 2024-06-12 12:51:51 +02:00
parent 341ff40e74
commit ff6180a4c9
13 changed files with 62 additions and 12 deletions

View file

@ -44,6 +44,8 @@ const THUMBNAIL_SELECTED_CLASS = "selected";
* mode.
* @property {AbortSignal} [abortSignal] - The AbortSignal for the window
* events.
* @property {boolean} [enableHWA] - Enables hardware acceleration for
* rendering. The default value is `false`.
*/
/**
@ -60,12 +62,14 @@ class PDFThumbnailViewer {
renderingQueue,
pageColors,
abortSignal,
enableHWA,
}) {
this.container = container;
this.eventBus = eventBus;
this.linkService = linkService;
this.renderingQueue = renderingQueue;
this.pageColors = pageColors || null;
this.enableHWA = enableHWA || false;
this.scroll = watchScroll(
this.container,
@ -206,6 +210,7 @@ class PDFThumbnailViewer {
linkService: this.linkService,
renderingQueue: this.renderingQueue,
pageColors: this.pageColors,
enableHWA: this.enableHWA,
});
this._thumbnails.push(thumbnail);
}