src/video/webgl/compositor.js
function () {
            if (this.length) {
                var gl = this.gl;

                // Copy data into stream buffer
                var len = this.length * ELEMENT_SIZE * ELEMENTS_PER_QUAD;
                gl.bufferData(
                    gl.ARRAY_BUFFER,
                    this.stream.subarray(0, len),
                    gl.STREAM_DRAW
                );

                // Draw the stream buffer
                gl.drawElements(
                    gl.TRIANGLES,
                    this.length * INDICES_PER_QUAD,
                    gl.UNSIGNED_SHORT,
                    0
                );

                this.sbIndex = 0;
                this.length = 0;
            }
        }
function () {
            if (this.length) {
                var gl = this.gl;

                // Copy data into stream buffer
                var len = this.length * ELEMENT_SIZE * ELEMENTS_PER_QUAD;
                gl.bufferData(
                    gl.ARRAY_BUFFER,
                    this.stream.subarray(0, len),
                    gl.STREAM_DRAW
                );

                // Draw the stream buffer
                gl.drawElements(
                    gl.TRIANGLES,
                    this.length * INDICES_PER_QUAD,
                    gl.UNSIGNED_SHORT,
                    0
                );

                this.sbIndex = 0;
                this.length = 0;
            }
        }
function ( ) { if ( this . length ) { var gl = this . gl ; // Copy data into stream buffer var len = this . length * ELEMENT_SIZE * ELEMENTS_PER_QUAD ; gl . bufferData ( gl . ARRAY_BUFFER , this . stream . subarray ( 0 , len ) , gl . STREAM_DRAW ) ; // Draw the stream buffer gl . drawElements ( gl . TRIANGLES , this . length * INDICES_PER_QUAD , gl . UNSIGNED_SHORT , 0 ) ; this . sbIndex = 0 ; this . length = 0 ; } }
Flush batched texture operations to the GPU
@name flush
@memberOf me.WebGLRenderer.Compositor
@function
Flush batched texture operations to the GPU