Jshinted code
also tweaked BaseTexture.fromCanvas function
This commit is contained in:
parent
8fa1f20eb2
commit
08945de8d6
6 changed files with 21 additions and 25 deletions
|
@ -5246,7 +5246,6 @@ PIXI.WebGLRenderer = function(width, height, view, transparent, antialias)
|
||||||
this.view.height = this.height;
|
this.view.height = this.height;
|
||||||
|
|
||||||
// deal with losing context..
|
// deal with losing context..
|
||||||
var scope = this;
|
|
||||||
|
|
||||||
this.contextLost = this.handleContextLost.bind(this);
|
this.contextLost = this.handleContextLost.bind(this);
|
||||||
this.contextRestoredLost = this.handleContextRestored.bind(this);
|
this.contextRestoredLost = this.handleContextRestored.bind(this);
|
||||||
|
@ -5665,7 +5664,6 @@ PIXI.WebGLRenderer.prototype.destroy = function()
|
||||||
{
|
{
|
||||||
|
|
||||||
// deal with losing context..
|
// deal with losing context..
|
||||||
var scope = this;
|
|
||||||
|
|
||||||
// remove listeners
|
// remove listeners
|
||||||
this.view.removeEventListener('webglcontextlost', this.contextLost);
|
this.view.removeEventListener('webglcontextlost', this.contextLost);
|
||||||
|
@ -5685,7 +5683,7 @@ PIXI.WebGLRenderer.prototype.destroy = function()
|
||||||
this.gl = null;
|
this.gl = null;
|
||||||
//
|
//
|
||||||
this.renderSession = null;
|
this.renderSession = null;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
PIXI.WebGLRenderer.glContextId = 0;
|
PIXI.WebGLRenderer.glContextId = 0;
|
||||||
|
@ -7041,7 +7039,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function()
|
||||||
{
|
{
|
||||||
var gl = this.gl;
|
var gl = this.gl;
|
||||||
|
|
||||||
this.filterStack = null
|
this.filterStack = null;
|
||||||
|
|
||||||
this.offsetX = 0;
|
this.offsetX = 0;
|
||||||
this.offsetY = 0;
|
this.offsetY = 0;
|
||||||
|
@ -7049,7 +7047,8 @@ PIXI.WebGLFilterManager.prototype.destroy = function()
|
||||||
// destroy textures
|
// destroy textures
|
||||||
for (var i = 0; i < this.texturePool.length; i++) {
|
for (var i = 0; i < this.texturePool.length; i++) {
|
||||||
this.texturePool.destroy();
|
this.texturePool.destroy();
|
||||||
};
|
}
|
||||||
|
|
||||||
this.texturePool = null;
|
this.texturePool = null;
|
||||||
|
|
||||||
//destroy buffers..
|
//destroy buffers..
|
||||||
|
@ -7057,7 +7056,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function()
|
||||||
gl.deleteBuffer(this.uvBuffer);
|
gl.deleteBuffer(this.uvBuffer);
|
||||||
gl.deleteBuffer(this.colorBuffer);
|
gl.deleteBuffer(this.colorBuffer);
|
||||||
gl.deleteBuffer(this.indexBuffer);
|
gl.deleteBuffer(this.indexBuffer);
|
||||||
}
|
};
|
||||||
|
|
||||||
PIXI.FilterTexture = function(gl, width, height)
|
PIXI.FilterTexture = function(gl, width, height)
|
||||||
{
|
{
|
||||||
|
@ -10711,15 +10710,14 @@ PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
|
||||||
{
|
{
|
||||||
if(!canvas._pixiId)
|
if(!canvas._pixiId)
|
||||||
{
|
{
|
||||||
canvas._pixiId = "canvas_" + PIXI.TextureCacheIdGenerator++;
|
canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++;
|
||||||
}
|
}
|
||||||
|
|
||||||
var baseTexture = PIXI.BaseTextureCache[canvas._pixiId];
|
var baseTexture = PIXI.BaseTextureCache[canvas._pixiId];
|
||||||
|
|
||||||
if(!baseTexture)
|
if(!baseTexture)
|
||||||
{
|
{
|
||||||
var baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
|
baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
|
||||||
baseTexture = new PIXI.Texture(baseTexture);
|
|
||||||
PIXI.BaseTextureCache[canvas._pixiId] = baseTexture;
|
PIXI.BaseTextureCache[canvas._pixiId] = baseTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10929,7 +10927,7 @@ PIXI.Texture.fromCanvas = function(canvas, scaleMode)
|
||||||
{
|
{
|
||||||
var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);
|
var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);
|
||||||
|
|
||||||
return new PIXI.Texture( baseTexture );
|
return new PIXI.Texture( baseTexture );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
10
bin/pixi.js
10
bin/pixi.js
File diff suppressed because one or more lines are too long
|
@ -36,7 +36,6 @@ PIXI.WebGLRenderer = function(width, height, view, transparent, antialias)
|
||||||
this.view.height = this.height;
|
this.view.height = this.height;
|
||||||
|
|
||||||
// deal with losing context..
|
// deal with losing context..
|
||||||
var scope = this;
|
|
||||||
|
|
||||||
this.contextLost = this.handleContextLost.bind(this);
|
this.contextLost = this.handleContextLost.bind(this);
|
||||||
this.contextRestoredLost = this.handleContextRestored.bind(this);
|
this.contextRestoredLost = this.handleContextRestored.bind(this);
|
||||||
|
@ -455,7 +454,6 @@ PIXI.WebGLRenderer.prototype.destroy = function()
|
||||||
{
|
{
|
||||||
|
|
||||||
// deal with losing context..
|
// deal with losing context..
|
||||||
var scope = this;
|
|
||||||
|
|
||||||
// remove listeners
|
// remove listeners
|
||||||
this.view.removeEventListener('webglcontextlost', this.contextLost);
|
this.view.removeEventListener('webglcontextlost', this.contextLost);
|
||||||
|
@ -475,7 +473,7 @@ PIXI.WebGLRenderer.prototype.destroy = function()
|
||||||
this.gl = null;
|
this.gl = null;
|
||||||
//
|
//
|
||||||
this.renderSession = null;
|
this.renderSession = null;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
PIXI.WebGLRenderer.glContextId = 0;
|
PIXI.WebGLRenderer.glContextId = 0;
|
||||||
|
|
|
@ -403,7 +403,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function()
|
||||||
{
|
{
|
||||||
var gl = this.gl;
|
var gl = this.gl;
|
||||||
|
|
||||||
this.filterStack = null
|
this.filterStack = null;
|
||||||
|
|
||||||
this.offsetX = 0;
|
this.offsetX = 0;
|
||||||
this.offsetY = 0;
|
this.offsetY = 0;
|
||||||
|
@ -411,7 +411,8 @@ PIXI.WebGLFilterManager.prototype.destroy = function()
|
||||||
// destroy textures
|
// destroy textures
|
||||||
for (var i = 0; i < this.texturePool.length; i++) {
|
for (var i = 0; i < this.texturePool.length; i++) {
|
||||||
this.texturePool.destroy();
|
this.texturePool.destroy();
|
||||||
};
|
}
|
||||||
|
|
||||||
this.texturePool = null;
|
this.texturePool = null;
|
||||||
|
|
||||||
//destroy buffers..
|
//destroy buffers..
|
||||||
|
@ -419,7 +420,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function()
|
||||||
gl.deleteBuffer(this.uvBuffer);
|
gl.deleteBuffer(this.uvBuffer);
|
||||||
gl.deleteBuffer(this.colorBuffer);
|
gl.deleteBuffer(this.colorBuffer);
|
||||||
gl.deleteBuffer(this.indexBuffer);
|
gl.deleteBuffer(this.indexBuffer);
|
||||||
}
|
};
|
||||||
|
|
||||||
PIXI.FilterTexture = function(gl, width, height)
|
PIXI.FilterTexture = function(gl, width, height)
|
||||||
{
|
{
|
||||||
|
|
|
@ -179,15 +179,14 @@ PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
|
||||||
{
|
{
|
||||||
if(!canvas._pixiId)
|
if(!canvas._pixiId)
|
||||||
{
|
{
|
||||||
canvas._pixiId = "canvas_" + PIXI.TextureCacheIdGenerator++;
|
canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++;
|
||||||
}
|
}
|
||||||
|
|
||||||
var baseTexture = PIXI.BaseTextureCache[canvas._pixiId];
|
var baseTexture = PIXI.BaseTextureCache[canvas._pixiId];
|
||||||
|
|
||||||
if(!baseTexture)
|
if(!baseTexture)
|
||||||
{
|
{
|
||||||
var baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
|
baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
|
||||||
baseTexture = new PIXI.Texture(baseTexture);
|
|
||||||
PIXI.BaseTextureCache[canvas._pixiId] = baseTexture;
|
PIXI.BaseTextureCache[canvas._pixiId] = baseTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ PIXI.Texture.fromCanvas = function(canvas, scaleMode)
|
||||||
{
|
{
|
||||||
var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);
|
var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);
|
||||||
|
|
||||||
return new PIXI.Texture( baseTexture );
|
return new PIXI.Texture( baseTexture );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue