From 00446473ee2281b0b65d922b837c145b5631095d Mon Sep 17 00:00:00 2001 From: Tom Peffer Date: Sat, 7 Mar 2020 18:04:17 +0100 Subject: [PATCH] Fixed missing "border" parameter in TexImage2D & TexImage2DAsync (WebGLContext) --- src/Blazor.Extensions.Canvas/WebGL/WebGLContext.cs | 8 ++++---- .../wwwroot/blazor.extensions.canvas.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Blazor.Extensions.Canvas/WebGL/WebGLContext.cs b/src/Blazor.Extensions.Canvas/WebGL/WebGLContext.cs index af290b2..0f90cd5 100644 --- a/src/Blazor.Extensions.Canvas/WebGL/WebGLContext.cs +++ b/src/Blazor.Extensions.Canvas/WebGL/WebGLContext.cs @@ -405,12 +405,12 @@ protected override async Task ExtendedInitializeAsync() public async Task IsTextureAsync(WebGLTexture texture) => await this.CallMethodAsync(IS_TEXTURE, texture); [Obsolete("Use the async version instead, which is already called internally.")] - public void TexImage2D(Texture2DType target, int level, PixelFormat internalFormat, int width, int height, PixelFormat format, PixelType type, T[] pixels) + public void TexImage2D(Texture2DType target, int level, PixelFormat internalFormat, int width, int height, int border, PixelFormat format, PixelType type, T[] pixels) where T : struct - => this.CallMethod(TEX_IMAGE_2D, target, level, internalFormat, width, height, format, type, pixels); - public async Task TexImage2DAsync(Texture2DType target, int level, PixelFormat internalFormat, int width, int height, PixelFormat format, PixelType type, T[] pixels) + => this.CallMethod(TEX_IMAGE_2D, target, level, internalFormat, width, height, border, format, type, pixels); + public async Task TexImage2DAsync(Texture2DType target, int level, PixelFormat internalFormat, int width, int height, int border, PixelFormat format, PixelType type, T[] pixels) where T : struct - => await this.BatchCallAsync(TEX_IMAGE_2D, isMethodCall: true, target, level, internalFormat, width, height, format, type, pixels); + => await this.BatchCallAsync(TEX_IMAGE_2D, isMethodCall: true, target, level, internalFormat, width, height, border, format, type, pixels); [Obsolete("Use the async version instead, which is already called internally.")] public void TexSubImage2D(Texture2DType target, int level, int xoffset, int yoffset, int width, int height, PixelFormat format, PixelType type, T[] pixels) diff --git a/src/Blazor.Extensions.Canvas/wwwroot/blazor.extensions.canvas.js b/src/Blazor.Extensions.Canvas/wwwroot/blazor.extensions.canvas.js index 7a02dc8..3114927 100644 --- a/src/Blazor.Extensions.Canvas/wwwroot/blazor.extensions.canvas.js +++ b/src/Blazor.Extensions.Canvas/wwwroot/blazor.extensions.canvas.js @@ -1,2 +1,2 @@ !function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(1);var i;!function(t){const e="BlazorExtensions",n={Canvas2d:new r.ContextManager("2d"),WebGL:new r.ContextManager("webgl")};t.initialize=function(){"undefined"==typeof window||window[e]?window[e]=Object.assign({},window[e],n):window[e]=Object.assign({},n)}}(i||(i={})),i.initialize()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.ContextManager=class{constructor(t){if(this.contexts=new Map,this.webGLObject=new Array,this.webGLContext=!1,this.webGLTypes=[WebGLBuffer,WebGLShader,WebGLProgram,WebGLFramebuffer,WebGLRenderbuffer,WebGLTexture,WebGLUniformLocation],this.add=((t,e)=>{if(!t)throw new Error("Invalid canvas.");if(!this.contexts.get(t.id)){var n;if(!(n=e?t.getContext(this.contextName,e):t.getContext(this.contextName)))throw new Error("Invalid context.");this.contexts.set(t.id,n)}}),this.remove=(t=>{this.contexts.delete(t.id)}),this.setProperty=((t,e,n)=>{const r=this.getContext(t);this.setPropertyWithContext(r,e,n)}),this.getProperty=((t,e)=>{const n=this.getContext(t);return this.serialize(n[e])}),this.call=((t,e,n)=>{const r=this.getContext(t);return this.callWithContext(r,e,n)}),this.callBatch=((t,e)=>{const n=this.getContext(t);for(let t=0;t0?r[0]:null)}}),this.callWithContext=((t,e,n)=>this.serialize(this.prototypes[e].apply(t,void 0!=n?n.map(t=>this.deserialize(e,t)):[]))),this.setPropertyWithContext=((t,e,n)=>{t[e]=this.deserialize(e,n)}),this.getContext=(t=>{if(!t)throw new Error("Invalid canvas.");const e=this.contexts.get(t.id);if(!e)throw new Error("Invalid context.");return e}),this.deserialize=((t,e)=>{if(!this.webGLContext||void 0==e)return e;if(e.hasOwnProperty("webGLType")&&e.hasOwnProperty("id"))return this.webGLObject[e.id];if(Array.isArray(e)&&!t.endsWith("v"))return Int8Array.of(...e);if("string"!=typeof e||"bufferData"!==t&&"bufferSubData"!==t)return e;{let t=window.atob(e),r=t.length,i=new Uint8Array(r);for(var n=0;n{if(t instanceof TextMetrics)return{width:t.width};if(!this.webGLContext||void 0==t)return t;const e=this.webGLTypes.find(e=>t instanceof e);if(void 0!=e){const n=this.webGLObject.length;return this.webGLObject.push(t),{webGLType:e.name,id:n}}return t}),this.contextName=t,"2d"===t)this.prototypes=CanvasRenderingContext2D.prototype;else{if("webgl"!==t&&"experimental-webgl"!==t)throw new Error(`Invalid context name: ${t}`);this.prototypes=WebGLRenderingContext.prototype,this.webGLContext=!0}}}}]); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6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XRlIHNlcmlhbGl6ZSA9IChvYmplY3Q6IGFueSkgPT4ge1xuICAgIGlmIChvYmplY3QgaW5zdGFuY2VvZiBUZXh0TWV0cmljcykge1xuICAgICAgICByZXR1cm4geyB3aWR0aDogb2JqZWN0LndpZHRoIH07XG4gICAgfVxuXG4gICAgaWYgKCF0aGlzLndlYkdMQ29udGV4dCB8fCBvYmplY3QgPT0gdW5kZWZpbmVkKSByZXR1cm4gb2JqZWN0OyAvL3NlcmlhbGl6YXRpb24gb25seSBuZWVkcyB0byBoYXBwZW4gZm9yIHdlYkdMXG5cbiAgICBjb25zdCB0eXBlID0gdGhpcy53ZWJHTFR5cGVzLmZpbmQoKHR5cGUpID0+IG9iamVjdCBpbnN0YW5jZW9mIHR5cGUpO1xuICAgIGlmICh0eXBlICE9IHVuZGVmaW5lZCkge1xuICAgICAgY29uc3QgaWQgPSB0aGlzLndlYkdMT2JqZWN0Lmxlbmd0aDtcbiAgICAgIHRoaXMud2ViR0xPYmplY3QucHVzaChvYmplY3QpO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICB3ZWJHTFR5cGU6IHR5cGUubmFtZSxcbiAgICAgICAgaWQ6IGlkXG4gICAgICAgIH07XG4gICAgfSBlbHNlXG4gICAgICByZXR1cm4gb2JqZWN0O1xuICB9XG59XG4iXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vLy4vc3JjL0luaXRpYWxpemVDYW52YXMudHMiLCJ3ZWJwYWNrOi8vLy4vc3JjL0NhbnZhc0NvbnRleHRNYW5hZ2VyLnRzIl0sIm5hbWVzIjpbImluc3RhbGxlZE1vZHVsZXMiLCJfX3dlYnBhY2tfcmVxdWlyZV9fIiwibW9kdWxlSWQiLCJleHBvcnRzIiwibW9kdWxlIiwiaSIsImwi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ICAgfVxyXG4gICAgICByZXR1cm4gYnl0ZXM7XHJcbiAgICB9IGVsc2VcclxuICAgICAgcmV0dXJuIG9iamVjdDtcclxuICB9XHJcblxyXG4gIHByaXZhdGUgc2VyaWFsaXplID0gKG9iamVjdDogYW55KSA9PiB7XHJcbiAgICBpZiAob2JqZWN0IGluc3RhbmNlb2YgVGV4dE1ldHJpY3MpIHtcclxuICAgICAgICByZXR1cm4geyB3aWR0aDogb2JqZWN0LndpZHRoIH07XHJcbiAgICB9XHJcblxyXG4gICAgaWYgKCF0aGlzLndlYkdMQ29udGV4dCB8fCBvYmplY3QgPT0gdW5kZWZpbmVkKSByZXR1cm4gb2JqZWN0OyAvL3NlcmlhbGl6YXRpb24gb25seSBuZWVkcyB0byBoYXBwZW4gZm9yIHdlYkdMXHJcblxyXG4gICAgY29uc3QgdHlwZSA9IHRoaXMud2ViR0xUeXBlcy5maW5kKCh0eXBlKSA9PiBvYmplY3QgaW5zdGFuY2VvZiB0eXBlKTtcclxuICAgIGlmICh0eXBlICE9IHVuZGVmaW5lZCkge1xyXG4gICAgICBjb25zdCBpZCA9IHRoaXMud2ViR0xPYmplY3QubGVuZ3RoO1xyXG4gICAgICB0aGlzLndlYkdMT2JqZWN0LnB1c2gob2JqZWN0KTtcclxuXHJcbiAgICAgIHJldHVybiB7XHJcbiAgICAgICAgd2ViR0xUeXBlOiB0eXBlLm5hbWUsXHJcbiAgICAgICAgaWQ6IGlkXHJcbiAgICAgICAgfTtcclxuICAgIH0gZWxzZVxyXG4gICAgICByZXR1cm4gb2JqZWN0O1xyXG4gIH1cclxufVxyXG4iXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file