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
|
@ -123,6 +123,8 @@ function isValidAnnotationEditorMode(mode) {
|
|||
* @property {Object} [pageColors] - Overwrites background and foreground colors
|
||||
* with user defined ones in order to improve readability in high contrast
|
||||
* mode.
|
||||
* @property {boolean} [enableHWA] - Enables hardware acceleration for
|
||||
* rendering. The default value is `false`.
|
||||
*/
|
||||
|
||||
class PDFPageViewBuffer {
|
||||
|
@ -211,6 +213,8 @@ class PDFViewer {
|
|||
|
||||
#containerTopLeft = null;
|
||||
|
||||
#enableHWA = false;
|
||||
|
||||
#enableHighlightFloatingButton = false;
|
||||
|
||||
#enablePermissions = false;
|
||||
|
@ -296,6 +300,7 @@ class PDFViewer {
|
|||
this.#enablePermissions = options.enablePermissions || false;
|
||||
this.pageColors = options.pageColors || null;
|
||||
this.#mlManager = options.mlManager || null;
|
||||
this.#enableHWA = options.enableHWA || false;
|
||||
|
||||
this.defaultRenderingQueue = !options.renderingQueue;
|
||||
if (
|
||||
|
@ -943,6 +948,7 @@ class PDFViewer {
|
|||
pageColors,
|
||||
l10n: this.l10n,
|
||||
layerProperties: this._layerProperties,
|
||||
enableHWA: this.#enableHWA,
|
||||
});
|
||||
this._pages.push(pageView);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue