@@ -112,22 +112,22 @@ var WebGLRenderer = new Class({
112112 this . type = CONST . WEBGL ;
113113
114114 /**
115- * The width of a rendered frame .
115+ * The width of the canvas being rendered to .
116116 *
117117 * @name Phaser.Renderer.WebGL.WebGLRenderer#width
118- * @type {number }
118+ * @type {integer }
119119 * @since 3.0.0
120120 */
121- this . width = game . config . width ;
121+ this . width = game . scale . canvasWidth ;
122122
123123 /**
124- * The height of a rendered frame .
124+ * The height of the canvas being rendered to .
125125 *
126126 * @name Phaser.Renderer.WebGL.WebGLRenderer#height
127- * @type {number }
127+ * @type {integer }
128128 * @since 3.0.0
129129 */
130- this . height = game . config . height ;
130+ this . height = game . scale . canvasHeight ;
131131
132132 /**
133133 * The canvas which this WebGL Renderer draws to.
@@ -567,7 +567,24 @@ var WebGLRenderer = new Class({
567567
568568 this . setBlendMode ( CONST . BlendModes . NORMAL ) ;
569569
570- this . resize ( this . width , this . height ) ;
570+ var width = this . width ;
571+ var height = this . height ;
572+
573+ gl . viewport ( 0 , 0 , width , height ) ;
574+
575+ var pipelines = this . pipelines ;
576+
577+ // Update all registered pipelines
578+ for ( var pipelineName in pipelines )
579+ {
580+ pipelines [ pipelineName ] . resize ( width , height , this . game . scale . resolution ) ;
581+ }
582+
583+ this . drawingBufferHeight = gl . drawingBufferHeight ;
584+
585+ this . defaultCamera . setSize ( width , height ) ;
586+
587+ gl . scissor ( 0 , ( this . drawingBufferHeight - height ) , width , height ) ;
571588
572589 this . game . events . once ( 'texturesready' , this . boot , this ) ;
573590
@@ -596,7 +613,7 @@ var WebGLRenderer = new Class({
596613 } ,
597614
598615 /**
599- * Resizes the internal canvas and drawing buffer.
616+ * Resizes the drawing buffer.
600617 *
601618 * @method Phaser.Renderer.WebGL.WebGLRenderer#resize
602619 * @since 3.0.0
@@ -610,20 +627,11 @@ var WebGLRenderer = new Class({
610627 {
611628 var gl = this . gl ;
612629 var pipelines = this . pipelines ;
613- var resolution = this . config . resolution ;
630+ var resolution = this . game . scale . resolution ;
614631
615632 this . width = Math . floor ( width * resolution ) ;
616633 this . height = Math . floor ( height * resolution ) ;
617634
618- this . canvas . width = this . width ;
619- this . canvas . height = this . height ;
620-
621- if ( this . config . autoResize )
622- {
623- this . canvas . style . width = ( this . width / resolution ) + 'px' ;
624- this . canvas . style . height = ( this . height / resolution ) + 'px' ;
625- }
626-
627635 gl . viewport ( 0 , 0 , this . width , this . height ) ;
628636
629637 // Update all registered pipelines
0 commit comments