mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[ts][webgl] Added . When it will disable the corresponding WebGL pixel store behaviour.
This commit is contained in:
parent
f3bcd6e28f
commit
4e96ebcda2
1
spine-ts/build/spine-all.d.ts
vendored
1
spine-ts/build/spine-all.d.ts
vendored
@ -1392,6 +1392,7 @@ declare module spine.webgl {
|
||||
private texture;
|
||||
private boundUnit;
|
||||
private useMipMaps;
|
||||
static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean;
|
||||
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
|
||||
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||
static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
|
||||
|
||||
@ -8521,6 +8521,8 @@ var spine;
|
||||
this.texture = this.context.gl.createTexture();
|
||||
}
|
||||
this.bind();
|
||||
if (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL)
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
|
||||
@ -8550,6 +8552,7 @@ var spine;
|
||||
var gl = this.context.gl;
|
||||
gl.deleteTexture(this.texture);
|
||||
};
|
||||
GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;
|
||||
return GLTexture;
|
||||
}(spine.Texture));
|
||||
webgl.GLTexture = GLTexture;
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
spine-ts/build/spine-player.d.ts
vendored
1
spine-ts/build/spine-player.d.ts
vendored
@ -1361,6 +1361,7 @@ declare module spine.webgl {
|
||||
private texture;
|
||||
private boundUnit;
|
||||
private useMipMaps;
|
||||
static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean;
|
||||
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
|
||||
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||
static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
|
||||
|
||||
@ -8253,6 +8253,8 @@ var spine;
|
||||
this.texture = this.context.gl.createTexture();
|
||||
}
|
||||
this.bind();
|
||||
if (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL)
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
|
||||
@ -8282,6 +8284,7 @@ var spine;
|
||||
var gl = this.context.gl;
|
||||
gl.deleteTexture(this.texture);
|
||||
};
|
||||
GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;
|
||||
return GLTexture;
|
||||
}(spine.Texture));
|
||||
webgl.GLTexture = GLTexture;
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
spine-ts/build/spine-webgl.d.ts
vendored
1
spine-ts/build/spine-webgl.d.ts
vendored
@ -1361,6 +1361,7 @@ declare module spine.webgl {
|
||||
private texture;
|
||||
private boundUnit;
|
||||
private useMipMaps;
|
||||
static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean;
|
||||
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
|
||||
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||
static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
|
||||
|
||||
@ -8253,6 +8253,8 @@ var spine;
|
||||
this.texture = this.context.gl.createTexture();
|
||||
}
|
||||
this.bind();
|
||||
if (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL)
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
|
||||
@ -8282,6 +8284,7 @@ var spine;
|
||||
var gl = this.context.gl;
|
||||
gl.deleteTexture(this.texture);
|
||||
};
|
||||
GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;
|
||||
return GLTexture;
|
||||
}(spine.Texture));
|
||||
webgl.GLTexture = GLTexture;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -34,6 +34,8 @@ module spine.webgl {
|
||||
private boundUnit = 0;
|
||||
private useMipMaps = false;
|
||||
|
||||
public static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;
|
||||
|
||||
constructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps: boolean = false) {
|
||||
super(image);
|
||||
this.context = context instanceof ManagedWebGLRenderingContext? context : new ManagedWebGLRenderingContext(context);
|
||||
@ -75,6 +77,7 @@ module spine.webgl {
|
||||
this.texture = this.context.gl.createTexture();
|
||||
}
|
||||
this.bind();
|
||||
if (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user