diff --git a/src/core/Application.js b/src/core/Application.js index ee15428..c48104a 100644 --- a/src/core/Application.js +++ b/src/core/Application.js @@ -49,6 +49,8 @@ * FXAA is faster, but may not always look as great **webgl only** * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices. * If you experience unexplained flickering try setting this to true. **webgl only** + * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance" + * for devices with dual graphics card **webgl only** * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.ticker.shared, `false` to create new ticker. * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.loaders.shared, `false` to create new Loader. */ diff --git a/src/core/Application.js b/src/core/Application.js index ee15428..c48104a 100644 --- a/src/core/Application.js +++ b/src/core/Application.js @@ -49,6 +49,8 @@ * FXAA is faster, but may not always look as great **webgl only** * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices. * If you experience unexplained flickering try setting this to true. **webgl only** + * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance" + * for devices with dual graphics card **webgl only** * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.ticker.shared, `false` to create new ticker. * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.loaders.shared, `false` to create new Loader. */ diff --git a/src/core/autoDetectRenderer.js b/src/core/autoDetectRenderer.js index 486d90b..7fd1c3e 100644 --- a/src/core/autoDetectRenderer.js +++ b/src/core/autoDetectRenderer.js @@ -30,6 +30,8 @@ * FXAA is faster, but may not always look as great **webgl only** * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices. * If you experience unexplained flickering try setting this to true. **webgl only** + * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance" + * for devices with dual graphics card **webgl only** * @return {PIXI.WebGLRenderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer */ export function autoDetectRenderer(options, arg1, arg2, arg3) diff --git a/src/core/Application.js b/src/core/Application.js index ee15428..c48104a 100644 --- a/src/core/Application.js +++ b/src/core/Application.js @@ -49,6 +49,8 @@ * FXAA is faster, but may not always look as great **webgl only** * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices. * If you experience unexplained flickering try setting this to true. **webgl only** + * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance" + * for devices with dual graphics card **webgl only** * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.ticker.shared, `false` to create new ticker. * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.loaders.shared, `false` to create new Loader. */ diff --git a/src/core/autoDetectRenderer.js b/src/core/autoDetectRenderer.js index 486d90b..7fd1c3e 100644 --- a/src/core/autoDetectRenderer.js +++ b/src/core/autoDetectRenderer.js @@ -30,6 +30,8 @@ * FXAA is faster, but may not always look as great **webgl only** * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices. * If you experience unexplained flickering try setting this to true. **webgl only** + * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance" + * for devices with dual graphics card **webgl only** * @return {PIXI.WebGLRenderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer */ export function autoDetectRenderer(options, arg1, arg2, arg3) diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index 9f8e97e..f2d1c12 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -53,7 +53,9 @@ * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area * (shown if not transparent). * @param {boolean} [options.legacy=false] - If true PixiJS will aim to ensure compatibility - * with older / less advanced devices. If you experiance unexplained flickering try setting this to true. + * with older / less advanced devices. If you experiance unexplained flickering try setting this to true. + * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance" + * for devices with dual graphics card */ constructor(options, arg2, arg3) { @@ -92,6 +94,7 @@ premultipliedAlpha: this.transparent && this.transparent !== 'notMultiplied', stencil: true, preserveDrawingBuffer: this.options.preserveDrawingBuffer, + powerPreference: this.options.powerPreference, }; this._backgroundColorRgba[3] = this.transparent ? 0 : 1;