diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index f991ca9..820d95f 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -323,11 +323,10 @@ context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]); //if smoothingEnabled is supported and we need to change the smoothing property for this texture - // if(this.smoothProperty && this.scaleMode !== displayObject.texture.baseTexture.scaleMode) { - // this.scaleMode = displayObject.texture.baseTexture.scaleMode; - // context[this.smoothProperty] = (this.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR); - //} - + if(renderSession.smoothProperty && renderSession.scaleMode !== displayObject.texture.baseTexture.scaleMode) { + renderSession.scaleMode = this.texture.baseTexture.scaleMode; + context[renderSession.smoothProperty] = (renderSession.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR); + } if(this.tint !== 0xFFFFFF) { diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index f991ca9..820d95f 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -323,11 +323,10 @@ context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]); //if smoothingEnabled is supported and we need to change the smoothing property for this texture - // if(this.smoothProperty && this.scaleMode !== displayObject.texture.baseTexture.scaleMode) { - // this.scaleMode = displayObject.texture.baseTexture.scaleMode; - // context[this.smoothProperty] = (this.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR); - //} - + if(renderSession.smoothProperty && renderSession.scaleMode !== displayObject.texture.baseTexture.scaleMode) { + renderSession.scaleMode = this.texture.baseTexture.scaleMode; + context[renderSession.smoothProperty] = (renderSession.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR); + } if(this.tint !== 0xFFFFFF) { diff --git a/src/pixi/renderers/canvas/CanvasRenderer.js b/src/pixi/renderers/canvas/CanvasRenderer.js index 48c2272..c4ffa4d 100644 --- a/src/pixi/renderers/canvas/CanvasRenderer.js +++ b/src/pixi/renderers/canvas/CanvasRenderer.js @@ -100,19 +100,6 @@ * @type Canvas 2d Context */ this.context = this.view.getContext( "2d", { alpha: this.transparent } ); - //some filter variables - this.smoothProperty = null; - - if("imageSmoothingEnabled" in this.context) - this.smoothProperty = "imageSmoothingEnabled"; - else if("webkitImageSmoothingEnabled" in this.context) - this.smoothProperty = "webkitImageSmoothingEnabled"; - else if("mozImageSmoothingEnabled" in this.context) - this.smoothProperty = "mozImageSmoothingEnabled"; - else if("oImageSmoothingEnabled" in this.context) - this.smoothProperty = "oImageSmoothingEnabled"; - - this.scaleMode = null; this.refresh = true; // hack to enable some hardware acceleration! @@ -124,10 +111,21 @@ this.maskManager = new PIXI.CanvasMaskManager(); - this.renderSession = {}; - this.renderSession.context = this.context; - this.renderSession.maskManager = this.maskManager; - + this.renderSession = { + context: this.context, + maskManager: this.maskManager, + scaleMode: null, + smoothProperty: null + }; + + if("imageSmoothingEnabled" in this.context) + this.renderSession.smoothProperty = "imageSmoothingEnabled"; + else if("webkitImageSmoothingEnabled" in this.context) + this.renderSession.smoothProperty = "webkitImageSmoothingEnabled"; + else if("mozImageSmoothingEnabled" in this.context) + this.renderSession.smoothProperty = "mozImageSmoothingEnabled"; + else if("oImageSmoothingEnabled" in this.context) + this.renderSession.smoothProperty = "oImageSmoothingEnabled"; }; // constructor