mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-26 11:41:23 +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 texture;
|
||||||
private boundUnit;
|
private boundUnit;
|
||||||
private useMipMaps;
|
private useMipMaps;
|
||||||
|
static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean;
|
||||||
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
|
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
|
||||||
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||||
static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
|
static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
|
||||||
|
|||||||
@ -8521,6 +8521,8 @@ var spine;
|
|||||||
this.texture = this.context.gl.createTexture();
|
this.texture = this.context.gl.createTexture();
|
||||||
}
|
}
|
||||||
this.bind();
|
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.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_MAG_FILTER, gl.LINEAR);
|
||||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : 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;
|
var gl = this.context.gl;
|
||||||
gl.deleteTexture(this.texture);
|
gl.deleteTexture(this.texture);
|
||||||
};
|
};
|
||||||
|
GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;
|
||||||
return GLTexture;
|
return GLTexture;
|
||||||
}(spine.Texture));
|
}(spine.Texture));
|
||||||
webgl.GLTexture = GLTexture;
|
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 texture;
|
||||||
private boundUnit;
|
private boundUnit;
|
||||||
private useMipMaps;
|
private useMipMaps;
|
||||||
|
static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean;
|
||||||
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
|
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
|
||||||
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||||
static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
|
static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
|
||||||
|
|||||||
@ -8253,6 +8253,8 @@ var spine;
|
|||||||
this.texture = this.context.gl.createTexture();
|
this.texture = this.context.gl.createTexture();
|
||||||
}
|
}
|
||||||
this.bind();
|
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.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_MAG_FILTER, gl.LINEAR);
|
||||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : 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;
|
var gl = this.context.gl;
|
||||||
gl.deleteTexture(this.texture);
|
gl.deleteTexture(this.texture);
|
||||||
};
|
};
|
||||||
|
GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;
|
||||||
return GLTexture;
|
return GLTexture;
|
||||||
}(spine.Texture));
|
}(spine.Texture));
|
||||||
webgl.GLTexture = GLTexture;
|
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 texture;
|
||||||
private boundUnit;
|
private boundUnit;
|
||||||
private useMipMaps;
|
private useMipMaps;
|
||||||
|
static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean;
|
||||||
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
|
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean);
|
||||||
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||||
static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
|
static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
|
||||||
|
|||||||
@ -8253,6 +8253,8 @@ var spine;
|
|||||||
this.texture = this.context.gl.createTexture();
|
this.texture = this.context.gl.createTexture();
|
||||||
}
|
}
|
||||||
this.bind();
|
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.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_MAG_FILTER, gl.LINEAR);
|
||||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : 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;
|
var gl = this.context.gl;
|
||||||
gl.deleteTexture(this.texture);
|
gl.deleteTexture(this.texture);
|
||||||
};
|
};
|
||||||
|
GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;
|
||||||
return GLTexture;
|
return GLTexture;
|
||||||
}(spine.Texture));
|
}(spine.Texture));
|
||||||
webgl.GLTexture = GLTexture;
|
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 boundUnit = 0;
|
||||||
private useMipMaps = false;
|
private useMipMaps = false;
|
||||||
|
|
||||||
|
public static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;
|
||||||
|
|
||||||
constructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps: boolean = false) {
|
constructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps: boolean = false) {
|
||||||
super(image);
|
super(image);
|
||||||
this.context = context instanceof ManagedWebGLRenderingContext? context : new ManagedWebGLRenderingContext(context);
|
this.context = context instanceof ManagedWebGLRenderingContext? context : new ManagedWebGLRenderingContext(context);
|
||||||
@ -75,6 +77,7 @@ module spine.webgl {
|
|||||||
this.texture = this.context.gl.createTexture();
|
this.texture = this.context.gl.createTexture();
|
||||||
}
|
}
|
||||||
this.bind();
|
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.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_MAG_FILTER, gl.LINEAR);
|
||||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : 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