Skip to content

Commit 7e90dab

Browse files
committed
FlatTintPipeline jsdoc comments
1 parent e385d01 commit 7e90dab

1 file changed

Lines changed: 121 additions & 111 deletions

File tree

src/renderer/webgl/pipelines/FlatTintPipeline.js

Lines changed: 121 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,25 @@ var pathArray = [];
3737

3838
/**
3939
* @classdesc
40-
* [pending] - explain what this pipeline handles and how the config object works.
40+
* The FlatTintPipeline is used for rendering flat colored shapes.
41+
* Mostyle used by the Graphics game object.
42+
* The config properties are:
43+
* - game: Current game instance.
44+
* - renderer: Current WebGL renderer.
45+
* - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES.
46+
* Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants).
47+
* - vertShader: Source for vertex shader as a string.
48+
* - fragShader: Source for fragment shader as a string.
49+
* - vertexCapacity: The amount of vertices that shall be allocated
50+
* - vertexSize: The size of a single vertex in bytes.
4151
*
4252
* @class FlatTintPipeline
4353
* @extends Phaser.Renderer.WebGL.WebGLPipeline
4454
* @memberOf Phaser.Renderer.WebGL.Pipelines
4555
* @constructor
4656
* @since 3.0.0
4757
*
48-
* @param {object} config - [description]
58+
* @param {object} config - Used for overriding shader an pipeline properties if extending this pipeline.
4959
*/
5060
var FlatTintPipeline = new Class({
5161

@@ -91,7 +101,7 @@ var FlatTintPipeline = new Class({
91101
});
92102

93103
/**
94-
* [pending]
104+
* Float32 view of the array buffer containing the pipeline's vertices.
95105
*
96106
* @name Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#vertexViewF32
97107
* @type {Float32Array}
@@ -100,7 +110,7 @@ var FlatTintPipeline = new Class({
100110
this.vertexViewF32 = new Float32Array(this.vertexData);
101111

102112
/**
103-
* [pending]
113+
* Uint32 view of the array buffer containing the pipeline's vertices.
104114
*
105115
* @name Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#vertexViewU32
106116
* @type {Uint32Array}
@@ -109,7 +119,7 @@ var FlatTintPipeline = new Class({
109119
this.vertexViewU32 = new Uint32Array(this.vertexData);
110120

111121
/**
112-
* [pending]
122+
* Used internally to draw triangles
113123
*
114124
* @name Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#tempTriangle
115125
* @type {array}
@@ -123,7 +133,7 @@ var FlatTintPipeline = new Class({
123133
];
124134

125135
/**
126-
* [pending]
136+
* Used internally by for triangulating a polyong
127137
*
128138
* @name Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#polygonCache
129139
* @type {array}
@@ -172,29 +182,29 @@ var FlatTintPipeline = new Class({
172182
},
173183

174184
/**
175-
* [pending]
185+
* Pushes a rectangle into the vertex batch
176186
*
177187
* @method Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#batchFillRect
178188
* @since 3.0.0
179189
*
180-
* @param {float} srcX - [pending]
181-
* @param {float} srcY - [pending]
182-
* @param {float} srcScaleX - [pending]
183-
* @param {float} srcScaleY - [pending]
184-
* @param {float} srcRotation - [pending]
185-
* @param {float} x - [pending]
186-
* @param {float} y - [pending]
187-
* @param {float} width - [pending]
188-
* @param {float} height - [pending]
189-
* @param {integer} fillColor - [pending]
190-
* @param {float} fillAlpha - [pending]
191-
* @param {float} a1 - [pending]
192-
* @param {float} b1 - [pending]
193-
* @param {float} c1 - [pending]
194-
* @param {float} d1 - [pending]
195-
* @param {float} e1 - [pending]
196-
* @param {float} f1 - [pending]
197-
* @param {Float32Array} currentMatrix - [pending]
190+
* @param {float} srcX - Graphics horizontal component for translation
191+
* @param {float} srcY - Graphics vertical component for translation
192+
* @param {float} srcScaleX - Graphics horizontal component for scale
193+
* @param {float} srcScaleY - Graphics vertical component for scale
194+
* @param {float} srcRotation - Graphics rotation
195+
* @param {float} x - Horiztonal top left coordinate of the rectangle
196+
* @param {float} y - Vertical top left coordinate of the rectangle
197+
* @param {float} width - Width of the rectangle
198+
* @param {float} height - Height of the rectangle
199+
* @param {integer} fillColor - RGB color packed as a uint
200+
* @param {float} fillAlpha - Alpha represented as float
201+
* @param {float} a1 - Matrix stack top a component
202+
* @param {float} b1 - Matrix stack top b component
203+
* @param {float} c1 - Matrix stack top c component
204+
* @param {float} d1 - Matrix stack top d component
205+
* @param {float} e1 - Matrix stack top e component
206+
* @param {float} f1 - Matrix stack top f component
207+
* @param {Float32Array} currentMatrix - Parent matrix, generally used by containers
198208
*/
199209
batchFillRect: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, x, y, width, height, fillColor, fillAlpha, a1, b1, c1, d1, e1, f1, currentMatrix)
200210
{
@@ -260,26 +270,26 @@ var FlatTintPipeline = new Class({
260270
* @method Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#batchFillTriangle
261271
* @since 3.0.0
262272
*
263-
* @param {float} srcX - [description]
264-
* @param {float} srcY - [description]
265-
* @param {float} srcScaleX - [description]
266-
* @param {float} srcScaleY - [description]
267-
* @param {float} srcRotation - [description]
268-
* @param {float} x0 - [pending]
269-
* @param {float} y0 - [pending]
270-
* @param {float} x1 - [pending]
271-
* @param {float} y1 - [pending]
272-
* @param {float} x2 - [pending]
273-
* @param {float} y2 - [pending]
274-
* @param {integer} fillColor - [description]
275-
* @param {float} fillAlpha - [description]
276-
* @param {float} a1 - [description]
277-
* @param {float} b1 - [description]
278-
* @param {float} c1 - [description]
279-
* @param {float} d1 - [description]
280-
* @param {float} e1 - [description]
281-
* @param {float} f1 - [description]
282-
* @param {Float32Array} currentMatrix - [description]
273+
* @param {float} srcX - Graphics horizontal component for translation
274+
* @param {float} srcY - Graphics vertical component for translation
275+
* @param {float} srcScaleX - Graphics horizontal component for scale
276+
* @param {float} srcScaleY - Graphics vertical component for scale
277+
* @param {float} srcRotation - Graphics rotation
278+
* @param {float} x0 - Point 0 x coordinate
279+
* @param {float} y0 - Point 0 y coordinate
280+
* @param {float} x1 - Point 1 x coordinate
281+
* @param {float} y1 - Point 1 y coordinate
282+
* @param {float} x2 - Point 2 x coordinate
283+
* @param {float} y2 - Point 2 y coordinate
284+
* @param {integer} fillColor - RGB color packed as a uint
285+
* @param {float} fillAlpha - Alpha represented as float
286+
* @param {float} a1 - Matrix stack top a component
287+
* @param {float} b1 - Matrix stack top b component
288+
* @param {float} c1 - Matrix stack top c component
289+
* @param {float} d1 - Matrix stack top d component
290+
* @param {float} e1 - Matrix stack top e component
291+
* @param {float} f1 - Matrix stack top f component
292+
* @param {Float32Array} currentMatrix - Parent matrix, generally used by containers
283293
*/
284294
batchFillTriangle: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, x0, y0, x1, y1, x2, y2, fillColor, fillAlpha, a1, b1, c1, d1, e1, f1, currentMatrix)
285295
{
@@ -332,27 +342,27 @@ var FlatTintPipeline = new Class({
332342
* @method Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#batchStrokeTriangle
333343
* @since 3.0.0
334344
*
335-
* @param {float} srcX - [description]
336-
* @param {float} srcY - [description]
337-
* @param {float} srcScaleX - [description]
338-
* @param {float} srcScaleY - [description]
339-
* @param {float} srcRotation - [description]
345+
* @param {float} srcX - Graphics horizontal component for translation
346+
* @param {float} srcY - Graphics vertical component for translation
347+
* @param {float} srcScaleX - Graphics horizontal component for scale
348+
* @param {float} srcScaleY - Graphics vertical component for scale
349+
* @param {float} srcRotation - Graphics rotation
340350
* @param {float} x0 - [description]
341351
* @param {float} y0 - [description]
342352
* @param {float} x1 - [description]
343353
* @param {float} y1 - [description]
344354
* @param {float} x2 - [description]
345355
* @param {float} y2 - [description]
346-
* @param {float} lineWidth - [pending]
347-
* @param {integer} lineColor - [pending]
348-
* @param {float} lineAlpha - [pending]
349-
* @param {float} a - [pending]
350-
* @param {float} b - [pending]
351-
* @param {float} c - [pending]
352-
* @param {float} d - [pending]
353-
* @param {float} e - [pending]
354-
* @param {float} f - [pending]
355-
* @param {Float32Array} currentMatrix - [description]
356+
* @param {float} lineWidth - Size of the line as a float value
357+
* @param {integer} lineColor - RGB color packed as a uint
358+
* @param {float} lineAlpha - Alpha represented as float
359+
* @param {float} a - Matrix stack top a component
360+
* @param {float} b - Matrix stack top b component
361+
* @param {float} c - Matrix stack top c component
362+
* @param {float} d - Matrix stack top d component
363+
* @param {float} e - Matrix stack top e component
364+
* @param {float} f - Matrix stack top f component
365+
* @param {Float32Array} currentMatrix - Parent matrix, generally used by containers
356366
*/
357367
batchStrokeTriangle: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, x0, y0, x1, y1, x2, y2, lineWidth, lineColor, lineAlpha, a, b, c, d, e, f, currentMatrix)
358368
{
@@ -394,21 +404,21 @@ var FlatTintPipeline = new Class({
394404
* @method Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#batchFillPath
395405
* @since 3.0.0
396406
*
397-
* @param {float} srcX - [description]
398-
* @param {float} srcY - [description]
399-
* @param {float} srcScaleX - [description]
400-
* @param {float} srcScaleY - [description]
401-
* @param {float} srcRotation - [description]
402-
* @param {float} path - [pending]
403-
* @param {integer} fillColor - [description]
404-
* @param {float} fillAlpha - [description]
405-
* @param {float} a1 - [description]
406-
* @param {float} b1 - [description]
407-
* @param {float} c1 - [description]
408-
* @param {float} d1 - [description]
409-
* @param {float} e1 - [description]
410-
* @param {float} f1 - [description]
411-
* @param {Float32Array} currentMatrix - [description]
407+
* @param {float} srcX - Graphics horizontal component for translation
408+
* @param {float} srcY - Graphics vertical component for translation
409+
* @param {float} srcScaleX - Graphics horizontal component for scale
410+
* @param {float} srcScaleY - Graphics vertical component for scale
411+
* @param {float} srcRotation - Graphics rotation
412+
* @param {float} path - Collection of points that represent the path
413+
* @param {integer} fillColor - RGB color packed as a uint
414+
* @param {float} fillAlpha - Alpha represented as float
415+
* @param {float} a1 - Matrix stack top a component
416+
* @param {float} b1 - Matrix stack top b component
417+
* @param {float} c1 - Matrix stack top c component
418+
* @param {float} d1 - Matrix stack top d component
419+
* @param {float} e1 - Matrix stack top e component
420+
* @param {float} f1 - Matrix stack top f component
421+
* @param {Float32Array} currentMatrix - Parent matrix, generally used by containers
412422
*/
413423
batchFillPath: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, path, fillColor, fillAlpha, a1, b1, c1, d1, e1, f1, currentMatrix)
414424
{
@@ -496,23 +506,23 @@ var FlatTintPipeline = new Class({
496506
* @method Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#batchStrokePath
497507
* @since 3.0.0
498508
*
499-
* @param {float} srcX - [description]
500-
* @param {float} srcY - [description]
501-
* @param {float} srcScaleX - [description]
502-
* @param {float} srcScaleY - [description]
503-
* @param {float} srcRotation - [description]
509+
* @param {float} srcX - Graphics horizontal component for translation
510+
* @param {float} srcY - Graphics vertical component for translation
511+
* @param {float} srcScaleX - Graphics horizontal component for scale
512+
* @param {float} srcScaleY - Graphics vertical component for scale
513+
* @param {float} srcRotation - Graphics rotation
504514
* @param {array} path - [description]
505515
* @param {float} lineWidth - [description]
506-
* @param {integer} lineColor - [description]
507-
* @param {float} lineAlpha - [description]
508-
* @param {float} a - [description]
509-
* @param {float} b - [description]
510-
* @param {float} c - [description]
511-
* @param {float} d - [description]
512-
* @param {float} e - [description]
513-
* @param {float} f - [description]
514-
* @param {boolean} isLastPath - [pending]
515-
* @param {Float32Array} currentMatrix - [description]
516+
* @param {integer} lineColor - RGB color packed as a uint
517+
* @param {float} lineAlpha - Alpha represented as float
518+
* @param {float} a - Matrix stack top a component
519+
* @param {float} b - Matrix stack top b component
520+
* @param {float} c - Matrix stack top c component
521+
* @param {float} d - Matrix stack top d component
522+
* @param {float} e - Matrix stack top e component
523+
* @param {float} f - Matrix stack top f component
524+
* @param {boolean} isLastPath - Indicates if the path should be closed
525+
* @param {Float32Array} currentMatrix - Parent matrix, generally used by containers
516526
*/
517527
batchStrokePath: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, path, lineWidth, lineColor, lineAlpha, a, b, c, d, e, f, isLastPath, currentMatrix)
518528
{
@@ -589,27 +599,27 @@ var FlatTintPipeline = new Class({
589599
* @method Phaser.Renderer.WebGL.Pipelines.FlatTintPipeline#batchLine
590600
* @since 3.0.0
591601
*
592-
* @param {float} srcX - [description]
593-
* @param {float} srcY - [description]
594-
* @param {float} srcScaleX - [description]
595-
* @param {float} srcScaleY - [description]
596-
* @param {float} srcRotation - [description]
597-
* @param {float} ax - [pending]
598-
* @param {float} ay - [pending]
599-
* @param {float} bx - [pending]
600-
* @param {float} by - [pending]
601-
* @param {float} aLineWidth - [pending]
602-
* @param {float} bLineWidth - [pending]
603-
* @param {integer} aLineColor - [pending]
604-
* @param {integer} bLineColor - [pending]
605-
* @param {float} lineAlpha - [description]
606-
* @param {float} a1 - [description]
607-
* @param {float} b1 - [description]
608-
* @param {float} c1 - [description]
609-
* @param {float} d1 - [description]
610-
* @param {float} e1 - [description]
611-
* @param {float} f1 - [description]
612-
* @param {Float32Array} currentMatrix - [description]
602+
* @param {float} srcX - Graphics horizontal component for translation
603+
* @param {float} srcY - Graphics vertical component for translation
604+
* @param {float} srcScaleX - Graphics horizontal component for scale
605+
* @param {float} srcScaleY - Graphics vertical component for scale
606+
* @param {float} srcRotation - Graphics rotation
607+
* @param {float} ax - X coordinate to the start of the line
608+
* @param {float} ay - Y coordinate to the start of the line
609+
* @param {float} bx - X coordinate to the end of the line
610+
* @param {float} by - Y coordinate to the end of the line
611+
* @param {float} aLineWidth - Width of the start of the line
612+
* @param {float} bLineWidth - Width of the end of the line
613+
* @param {integer} aLineColor - RGB color packed as a uint
614+
* @param {integer} bLineColor - RGB color packed as a uint
615+
* @param {float} lineAlpha - Alpha represented as float
616+
* @param {float} a1 - Matrix stack top a component
617+
* @param {float} b1 - Matrix stack top b component
618+
* @param {float} c1 - Matrix stack top c component
619+
* @param {float} d1 - Matrix stack top d component
620+
* @param {float} e1 - Matrix stack top e component
621+
* @param {float} f1 - Matrix stack top f component
622+
* @param {Float32Array} currentMatrix - Parent matrix, generally used by containers
613623
*/
614624
batchLine: function (srcX, srcY, srcScaleX, srcScaleY, srcRotation, ax, ay, bx, by, aLineWidth, bLineWidth, aLineColor, bLineColor, lineAlpha, a1, b1, c1, d1, e1, f1, currentMatrix)
615625
{

0 commit comments

Comments
 (0)