Tweaked Graphics to only flush SpriteBatch if it has children to render

This commit is contained in:
Mat Groves 2014-01-15 11:48:14 +00:00
parent aeac4a5f4e
commit 73aa9dca93
3 changed files with 25 additions and 15 deletions

View file

@ -7414,6 +7414,9 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession)
PIXI.WebGLGraphics.renderGraphics(this, renderSession);
// only rende rif it has children!
if(this.children.length)
{
renderSession.spriteBatch.start();
// simple render children!
@ -7424,6 +7427,8 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession)
renderSession.spriteBatch.stop();
}
if(this._filters)renderSession.filterManager.popFilter();
if(this._mask)renderSession.maskManager.popMask(renderSession);

File diff suppressed because one or more lines are too long

View file

@ -331,6 +331,9 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession)
PIXI.WebGLGraphics.renderGraphics(this, renderSession);
// only rende rif it has children!
if(this.children.length)
{
renderSession.spriteBatch.start();
// simple render children!
@ -341,6 +344,8 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession)
renderSession.spriteBatch.stop();
}
if(this._filters)renderSession.filterManager.popFilter();
if(this._mask)renderSession.maskManager.popMask(renderSession);