optimized renderer
by not using getter/setter in render loop when checking filters/masks
This commit is contained in:
parent
273d78aa85
commit
f0c082a3cc
4 changed files with 101 additions and 30 deletions
|
@ -1390,16 +1390,16 @@ PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession)
|
|||
{
|
||||
if(this.visible === false || this.alpha === 0)return;
|
||||
|
||||
if(this.mask || this.filters)
|
||||
if(this._mask || this._filters)
|
||||
{
|
||||
if(this.mask)
|
||||
if(this._mask)
|
||||
{
|
||||
renderSession.spriteBatch.stop();
|
||||
renderSession.maskManager.pushMask(this.mask, renderSession.projection);
|
||||
renderSession.spriteBatch.start();
|
||||
}
|
||||
|
||||
if(this.filters)
|
||||
if(this._filters)
|
||||
{
|
||||
renderSession.spriteBatch.flush();
|
||||
renderSession.filterManager.pushFilter(this._filterBlock);
|
||||
|
@ -1414,8 +1414,8 @@ PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession)
|
|||
|
||||
renderSession.spriteBatch.stop();
|
||||
|
||||
if(this.filters)renderSession.filterManager.popFilter();
|
||||
if(this.mask)renderSession.maskManager.popMask(renderSession.projection);
|
||||
if(this._filters)renderSession.filterManager.popFilter();
|
||||
if(this._mask)renderSession.maskManager.popMask(renderSession.projection);
|
||||
|
||||
renderSession.spriteBatch.start();
|
||||
}
|
||||
|
@ -1434,9 +1434,9 @@ PIXI.DisplayObjectContainer.prototype._renderCanvas = function(renderSession)
|
|||
{
|
||||
if(this.visible === false || this.alpha === 0)return;
|
||||
|
||||
if(this.mask)
|
||||
if(this._mask)
|
||||
{
|
||||
renderSession.maskManager.pushMask(this.mask, renderSession.context);
|
||||
renderSession.maskManager.pushMask(this._mask, renderSession.context);
|
||||
}
|
||||
|
||||
for(var i=0,j=this.children.length; i<j; i++)
|
||||
|
@ -1461,8 +1461,6 @@ PIXI.blendModes.ADD = 1;
|
|||
PIXI.blendModes.MULTIPLY = 2;
|
||||
PIXI.blendModes.SCREEN = 3;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The SPrite object is the base for all textured objects that are rendered to the screen
|
||||
*
|
||||
|
@ -1696,16 +1694,16 @@ PIXI.Sprite.prototype._renderWebGL = function(renderSession)
|
|||
{
|
||||
if(this.visible === false || this.alpha === 0)return;
|
||||
|
||||
if(this.mask || this.filters)
|
||||
if(this._mask || this._filters)
|
||||
{
|
||||
if(this.mask)
|
||||
if(this._mask)
|
||||
{
|
||||
renderSession.spriteBatch.stop();
|
||||
renderSession.maskManager.pushMask(this.mask, renderSession.projection);
|
||||
renderSession.spriteBatch.start();
|
||||
}
|
||||
|
||||
if(this.filters)
|
||||
if(this._filters)
|
||||
{
|
||||
renderSession.spriteBatch.flush();
|
||||
renderSession.filterManager.pushFilter(this._filterBlock);
|
||||
|
@ -1722,8 +1720,8 @@ PIXI.Sprite.prototype._renderWebGL = function(renderSession)
|
|||
|
||||
renderSession.spriteBatch.stop();
|
||||
|
||||
if(this.filters)renderSession.filterManager.popFilter();
|
||||
if(this.mask)renderSession.maskManager.popMask(renderSession.projection);
|
||||
if(this._filters)renderSession.filterManager.popFilter();
|
||||
if(this._mask)renderSession.maskManager.popMask(renderSession.projection);
|
||||
|
||||
renderSession.spriteBatch.start();
|
||||
}
|
||||
|
@ -1745,7 +1743,11 @@ PIXI.Sprite.prototype._renderWebGL = function(renderSession)
|
|||
|
||||
PIXI.Sprite.prototype._renderCanvas = function(renderSession)
|
||||
{
|
||||
|
||||
if(this._mask)
|
||||
{
|
||||
renderSession.maskManager.pushMask(this._mask, renderSession.context);
|
||||
}
|
||||
|
||||
var frame = this.texture.frame;
|
||||
var context = renderSession.context;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue