Tweaked Graphics to only flush SpriteBatch if it has children to render
This commit is contained in:
parent
aeac4a5f4e
commit
73aa9dca93
3 changed files with 25 additions and 15 deletions
|
@ -7414,15 +7414,20 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession)
|
||||||
|
|
||||||
PIXI.WebGLGraphics.renderGraphics(this, renderSession);
|
PIXI.WebGLGraphics.renderGraphics(this, renderSession);
|
||||||
|
|
||||||
renderSession.spriteBatch.start();
|
// only rende rif it has children!
|
||||||
|
if(this.children.length)
|
||||||
// simple render children!
|
|
||||||
for(var i=0, j=this.children.length; i<j; i++)
|
|
||||||
{
|
{
|
||||||
this.children[i]._renderWebGL(renderSession);
|
renderSession.spriteBatch.start();
|
||||||
}
|
|
||||||
|
|
||||||
renderSession.spriteBatch.stop();
|
// simple render children!
|
||||||
|
for(var i=0, j=this.children.length; i<j; i++)
|
||||||
|
{
|
||||||
|
this.children[i]._renderWebGL(renderSession);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderSession.spriteBatch.stop();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if(this._filters)renderSession.filterManager.popFilter();
|
if(this._filters)renderSession.filterManager.popFilter();
|
||||||
if(this._mask)renderSession.maskManager.popMask(renderSession);
|
if(this._mask)renderSession.maskManager.popMask(renderSession);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -331,15 +331,20 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession)
|
||||||
|
|
||||||
PIXI.WebGLGraphics.renderGraphics(this, renderSession);
|
PIXI.WebGLGraphics.renderGraphics(this, renderSession);
|
||||||
|
|
||||||
renderSession.spriteBatch.start();
|
// only rende rif it has children!
|
||||||
|
if(this.children.length)
|
||||||
// simple render children!
|
|
||||||
for(var i=0, j=this.children.length; i<j; i++)
|
|
||||||
{
|
{
|
||||||
this.children[i]._renderWebGL(renderSession);
|
renderSession.spriteBatch.start();
|
||||||
}
|
|
||||||
|
|
||||||
renderSession.spriteBatch.stop();
|
// simple render children!
|
||||||
|
for(var i=0, j=this.children.length; i<j; i++)
|
||||||
|
{
|
||||||
|
this.children[i]._renderWebGL(renderSession);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderSession.spriteBatch.stop();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if(this._filters)renderSession.filterManager.popFilter();
|
if(this._filters)renderSession.filterManager.popFilter();
|
||||||
if(this._mask)renderSession.maskManager.popMask(renderSession);
|
if(this._mask)renderSession.maskManager.popMask(renderSession);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue