Skip to content

Commit 81800e0

Browse files
committed
WebGLRenderer.whiteTexture is a new property that is a reference to a pure white 4x4 texture that is created during Boot by the Texture Manager. The Multi Pipeline uses this internally for all Graphic, Shape and fill rendering.
1 parent 81b63cd commit 81800e0

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,17 @@ var WebGLRenderer = new Class({
445445
*/
446446
this.blankTexture = null;
447447

448+
/**
449+
* A pure white 4x4 texture, as used by the Graphics system where needed.
450+
* This is set in the `boot` method.
451+
*
452+
* @name Phaser.Renderer.WebGL.WebGLRenderer#whiteTexture
453+
* @type {WebGLTexture}
454+
* @readonly
455+
* @since 3.50.0
456+
*/
457+
this.whiteTexture = null;
458+
448459
/**
449460
* A default Camera used in calls when no other camera has been provided.
450461
*
@@ -826,11 +837,10 @@ var WebGLRenderer = new Class({
826837

827838
var multi = this.pipelines.get(PIPELINE_CONST.MULTI_PIPELINE);
828839

829-
var blank = game.textures.getFrame('__DEFAULT');
830-
831-
multi.currentFrame = blank;
840+
this.blankTexture = game.textures.getFrame('__DEFAULT');
841+
this.whiteTexture = game.textures.getFrame('__WHITE');
832842

833-
this.blankTexture = blank;
843+
multi.currentFrame = this.whiteTexture;
834844

835845
var gl = this.gl;
836846

0 commit comments

Comments
 (0)