@@ -16,6 +16,12 @@ var FlatTintPipeline = require('./pipelines/FlatTintPipeline');
1616var ForwardDiffuseLightPipeline = require ( './pipelines/ForwardDiffuseLightPipeline' ) ;
1717var TextureTintPipeline = require ( './pipelines/TextureTintPipeline' ) ;
1818
19+ /**
20+ * @callback WebGLContextCallback
21+ *
22+ * @param {Phaser.Renderer.WebGL.WebGLRenderer } renderer - [description]
23+ */
24+
1925/**
2026 * @classdesc
2127 * [description]
@@ -115,7 +121,7 @@ var WebGLRenderer = new Class({
115121 * [description]
116122 *
117123 * @name Phaser.Renderer.WebGL.WebGLRenderer#lostContextCallbacks
118- * @type {function [] }
124+ * @type {WebGLContextCallback [] }
119125 * @since 3.0.0
120126 */
121127 this . lostContextCallbacks = [ ] ;
@@ -124,7 +130,7 @@ var WebGLRenderer = new Class({
124130 * [description]
125131 *
126132 * @name Phaser.Renderer.WebGL.WebGLRenderer#restoredContextCallbacks
127- * @type {function [] }
133+ * @type {WebGLContextCallback [] }
128134 * @since 3.0.0
129135 */
130136 this . restoredContextCallbacks = [ ] ;
@@ -384,7 +390,7 @@ var WebGLRenderer = new Class({
384390 var canvas = this . canvas ;
385391 var clearColor = config . backgroundColor ;
386392 var gl = canvas . getContext ( 'webgl' , config . contextCreation ) || canvas . getContext ( 'experimental-webgl' , config . contextCreation ) ;
387-
393+
388394 if ( ! gl )
389395 {
390396 this . contextLost = true ;
@@ -431,10 +437,10 @@ var WebGLRenderer = new Class({
431437 this . addPipeline ( 'FlatTintPipeline' , new FlatTintPipeline ( { game : this . game , renderer : this } ) ) ;
432438 this . addPipeline ( 'BitmapMaskPipeline' , new BitmapMaskPipeline ( { game : this . game , renderer : this } ) ) ;
433439 this . addPipeline ( 'Light2D' , new ForwardDiffuseLightPipeline ( { game : this . game , renderer : this } ) ) ;
434-
440+
435441 this . setBlendMode ( CONST . BlendModes . NORMAL ) ;
436442 this . resize ( this . width , this . height ) ;
437-
443+
438444 return this ;
439445 } ,
440446
@@ -457,7 +463,7 @@ var WebGLRenderer = new Class({
457463
458464 this . width = Math . floor ( width * resolution ) ;
459465 this . height = Math . floor ( height * resolution ) ;
460-
466+
461467 this . canvas . width = this . width ;
462468 this . canvas . height = this . height ;
463469
@@ -484,7 +490,7 @@ var WebGLRenderer = new Class({
484490 * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextRestored
485491 * @since 3.0.0
486492 *
487- * @param {function } callback - [description]
493+ * @param {WebGLContextCallback } callback - [description]
488494 * @param {object } target - [description]
489495 *
490496 * @return {Phaser.Renderer.WebGL.WebGLRenderer } [description]
@@ -502,7 +508,7 @@ var WebGLRenderer = new Class({
502508 * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextLost
503509 * @since 3.0.0
504510 *
505- * @param {function } callback - [description]
511+ * @param {WebGLContextCallback } callback - [description]
506512 * @param {object } target - [description]
507513 *
508514 * @return {Phaser.Renderer.WebGL.WebGLRenderer } [description]
@@ -713,7 +719,7 @@ var WebGLRenderer = new Class({
713719 scissorStack [ stackIndex + 1 ] = currentScissor [ 1 ] ;
714720 scissorStack [ stackIndex + 2 ] = currentScissor [ 2 ] ;
715721 scissorStack [ stackIndex + 3 ] = currentScissor [ 3 ] ;
716-
722+
717723 this . currentScissorIdx += 4 ;
718724 this . setScissor ( x , y , w , h ) ;
719725
@@ -732,15 +738,15 @@ var WebGLRenderer = new Class({
732738 {
733739 var scissorStack = this . scissorStack ;
734740 var stackIndex = this . currentScissorIdx - 4 ;
735-
741+
736742 var x = scissorStack [ stackIndex + 0 ] ;
737743 var y = scissorStack [ stackIndex + 1 ] ;
738744 var w = scissorStack [ stackIndex + 2 ] ;
739745 var h = scissorStack [ stackIndex + 3 ] ;
740746
741747 this . currentScissorIdx = stackIndex ;
742748 this . setScissor ( x , y , w , h ) ;
743-
749+
744750 return this ;
745751 } ,
746752
@@ -1002,7 +1008,7 @@ var WebGLRenderer = new Class({
10021008 if ( indexBuffer !== this . currentIndexBuffer )
10031009 {
10041010 this . flush ( ) ;
1005-
1011+
10061012 gl . bindBuffer ( gl . ELEMENT_ARRAY_BUFFER , indexBuffer ) ;
10071013
10081014 this . currentIndexBuffer = indexBuffer ;
@@ -1089,7 +1095,7 @@ var WebGLRenderer = new Class({
10891095 pma = ( pma === undefined || pma === null ) ? true : pma ;
10901096
10911097 this . setTexture2D ( texture , 0 ) ;
1092-
1098+
10931099 gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_MIN_FILTER , minFilter ) ;
10941100 gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_MAG_FILTER , magFilter ) ;
10951101 gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_WRAP_S , wrapS ) ;
@@ -1356,7 +1362,7 @@ var WebGLRenderer = new Class({
13561362 var ch = Math . floor ( camera . height * resolution ) ;
13571363
13581364 this . pushScissor ( cx , cy , cw , ch ) ;
1359-
1365+
13601366 if ( camera . backgroundColor . alphaGL > 0 )
13611367 {
13621368 var color = camera . backgroundColor ;
@@ -1533,7 +1539,7 @@ var WebGLRenderer = new Class({
15331539 * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshot
15341540 * @since 3.0.0
15351541 *
1536- * @param {function } callback - [description]
1542+ * @param {SnapshotCallback } callback - [description]
15371543 * @param {string } type - [description]
15381544 * @param {float } encoderOptions - [description]
15391545 *
@@ -1894,7 +1900,7 @@ var WebGLRenderer = new Class({
18941900 {
18951901 this . getExtension ( 'WEBGL_lose_context' ) . loseContext ( ) ;
18961902 }
1897-
1903+
18981904 delete this . gl ;
18991905 delete this . game ;
19001906
0 commit comments