Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
return;
}
if ((texture.mipmap === MIPMAP_MODES.POW2 || this.webGLVersion !== 2) && !texture.isPowerOfTwo)
{
glTexture.mipmap = 0;
}
else
{
glTexture.mipmap = texture.mipmap >= 1;
}
if (this.webGLVersion !== 2 && !texture.isPowerOfTwo)
{
glTexture.wrapMode = WRAP_MODES.CLAMP;
}
else
{
glTexture.wrapMode = texture.wrapMode;
}
if (texture.resource && texture.resource.style(this.renderer, texture, glTexture))
{
// style is set, dont do anything!
}
else
{
this.setStyle(texture, glTexture);
}
glTexture.dirtyStyleId = texture.dirtyStyleId;
let isSimple = baseTex.isPowerOfTwo
&& tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;
// auto, force repeat wrapMode for big tiling textures
if (isSimple)
{
if (!baseTex._glTextures[renderer.CONTEXT_UID])
{
if (baseTex.wrapMode === WRAP_MODES.CLAMP)
{
baseTex.wrapMode = WRAP_MODES.REPEAT;
}
}
else
{
isSimple = baseTex.wrapMode !== WRAP_MODES.CLAMP;
}
}
const shader = isSimple ? this.simpleShader : this.shader;
const w = tex.width;
const h = tex.height;
const W = ts._width;
const H = ts._height;
tempMat.set(lt.a * w / W,
lt.b * w / H,
lt.c * h / W,
lt.d * h / H,
lt.tx / W,
lt.ty / H);
quad.invalidate();
const tex = ts._texture;
const baseTex = tex.baseTexture;
const lt = ts.tileTransform.localTransform;
const uv = ts.uvMatrix;
let isSimple = baseTex.isPowerOfTwo
&& tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;
// auto, force repeat wrapMode for big tiling textures
if (isSimple)
{
if (!baseTex._glTextures[renderer.CONTEXT_UID])
{
if (baseTex.wrapMode === WRAP_MODES.CLAMP)
{
baseTex.wrapMode = WRAP_MODES.REPEAT;
}
}
else
{
isSimple = baseTex.wrapMode !== WRAP_MODES.CLAMP;
}
}
const shader = isSimple ? this.simpleShader : this.shader;
const w = tex.width;
const h = tex.height;
const W = ts._width;
const H = ts._height;
texture._glTextures[this.renderer.CONTEXT_UID] = glTexture;
texture.on('update', this.updateTexture, this);
texture.on('dispose', this.destroyTexture, this);
this._managedTextures.push(texture);
if (texture.isPowerOfTwo)
{
if (texture.mipmap)
{
glTexture.enableMipmap();
}
if (texture.wrapMode === WRAP_MODES.CLAMP)
{
glTexture.enableWrapClamp();
}
else if (texture.wrapMode === WRAP_MODES.REPEAT)
{
glTexture.enableWrapRepeat();
}
else
{
glTexture.enableWrapMirrorRepeat();
}
}
else
{
glTexture.enableWrapClamp();
}