mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Add an option to enable/disable hardware acceleration (bug 1902012)
This commit is contained in:
parent
341ff40e74
commit
ff6180a4c9
13 changed files with 62 additions and 12 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue