@rive-app/webgl-advanced 1.0.45 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rive.wasm +0 -0
- package/webgl_advanced.mjs +3 -3
package/package.json
CHANGED
package/rive.wasm
CHANGED
|
Binary file
|
package/webgl_advanced.mjs
CHANGED
|
@@ -13,9 +13,9 @@ function ca(){function a(g){const h=d;c=b=0;d=new Map;h.forEach(n=>{try{n(g)}cat
|
|
|
13
13
|
function da(){console.assert(!0);const a=new Map;let b=-Infinity;this.push=function(c){c=c+255>>8;a.has(c)&&clearTimeout(a.get(c));a.set(c,setTimeout(function(){a.delete(c);0==a.length?b=-Infinity:c==b&&(b=Math.max(...a.keys()),console.assert(b<c))},1E3));b=Math.max(c,b);return b<<8}}
|
|
14
14
|
k.onRuntimeInitialized=function(){function a(u){this.od=u;this.le=u.getContext("2d");this.pe=e;this.td=[];this.Dd=0;this.clear=function(){console.assert(0==this.Dd);this.td=[];f.delete(this)};this.save=function(){++this.Dd;this.td.push(e.save.bind(e))};this.restore=function(){0<this.Dd&&(this.td.push(e.restore.bind(e)),--this.Dd)};this.transform=function(l){this.td.push(e.transform.bind(e,l))};this.align=function(l,t,v,z){this.td.push(e.align.bind(e,l,t,v,z))};this.computeAlignment=function(l,t,v,
|
|
15
15
|
z,E){this.td.push(e.computeAlignment.bind(e,l,t,v,z,E))};this.flush=function(){console.assert(0==this.Dd);f.add(this);d&&c()}}function b(u){var l={alpha:1,depth:0,stencil:8,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,preferLowPowerToHighPerformance:0,failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:0,renderViaOffscreenBackBuffer:0},t=u.getContext("webgl2",l);t||(t=u.getContext("webgl",l));var v=t,z=ea(fa),E={Te:z,attributes:l,version:l.Ue,Td:v};v.canvas&&
|
|
16
|
-
(v.canvas.Re=E);fa[z]=E;("undefined"===typeof l.ue||l.ue)&&ha(E);m=fa[z];k.re=r=m&&m.Td;l=g(u.width,u.height);l.ne=z;l.od=u;l.be=u.width;l.ae=u.height;l.me=t;return l}function c(){
|
|
17
|
-
|
|
18
|
-
D.Id+D.zd,D.Jd+D.yd);let X=new k.Mat2D;X.xx=D.zd/D.od.width;X.yy=D.yd/D.od.height;X.xy=X.yx=0;X.tx=D.Id;X.ty=D.Jd;e.transform(X);for(const mb of D.td)mb();e.restoreClipRect();D.td=[]}for(e.flush();A<E;++A)F=z[A],D=F.le,D.globalCompositeOperation="copy",D.drawImage(e.od,F.Id,F.Jd,F.zd,F.yd,0,0,F.od.width,F.od.height);A=E}}}const d=navigator.userAgent.match(/firefox|fxios/i);let e=null;const f=new Set,g=k.makeRenderer;k.makeRenderer=function(u,l){return l?(e||(e=b(document.createElement("canvas")),
|
|
16
|
+
(v.canvas.Re=E);fa[z]=E;("undefined"===typeof l.ue||l.ue)&&ha(E);m=fa[z];k.re=r=m&&m.Td;l=g(u.width,u.height);l.ne=z;l.od=u;l.be=u.width;l.ae=u.height;l.me=t;return l}function c(){if(e){var u=e.oe,l=0,t=0,v=0,z=Array(f.size),E=0;for(var A of f)A.zd=Math.min(A.od.width,u),A.yd=Math.min(A.od.height,u),A.Ud=A.yd*A.zd,l=Math.max(l,A.zd),t=Math.max(t,A.yd),v+=A.Ud,z[E++]=A;f.clear();if(!(0>=v)){l=1<<(0>=l?0:32-Math.clz32(l-1));for(t=1<<(0>=t?0:32-Math.clz32(t-1));t*l<v;)l<=t?l*=2:t*=2;l=Math.min(l,u);
|
|
17
|
+
l=Math.min(t,u);z.sort((X,mb)=>mb.Ud-X.Ud);v=new k.DynamicRectanizer(u);for(A=0;A<z.length;){v.reset(l,t);for(E=A;E<z.length;++E){var F=z[E],D=v.addRect(F.zd,F.yd);if(0>D){console.assert(E>A);break}F.Id=D&65535;F.Jd=D>>16}F=n.push(v.drawWidth());D=p.push(v.drawHeight());console.assert(F>=v.drawWidth());console.assert(D>=v.drawHeight());console.assert(F<=u);console.assert(D<=u);e.od.width!=F&&(e.od.width=F);e.od.height!=D&&(e.od.height=D);e.clear();for(F=A;F<E;++F){D=z[F];e.saveClipRect(D.Id,D.Jd,
|
|
18
|
+
D.Id+D.zd,D.Jd+D.yd);let X=new k.Mat2D;X.xx=D.zd/D.od.width;X.yy=D.yd/D.od.height;X.xy=X.yx=0;X.tx=D.Id;X.ty=D.Jd;e.transform(X);for(const mb of D.td)mb();e.restoreClipRect();D.td=[]}for(e.flush();A<E;++A)F=z[A],D=F.le,D.globalCompositeOperation="copy",D.drawImage(e.od,F.Id,F.Jd,F.zd,F.yd,0,0,F.od.width,F.od.height);A=E}}}}const d=navigator.userAgent.match(/firefox|fxios/i);let e=null;const f=new Set,g=k.makeRenderer;k.makeRenderer=function(u,l){return l?(e||(e=b(document.createElement("canvas")),
|
|
19
19
|
l=e.me,e.oe=Math.min(l.getParameter(l.MAX_RENDERBUFFER_SIZE),l.getParameter(l.MAX_TEXTURE_SIZE))),new a(u)):b(u)};const h=k.Artboard.prototype.draw;k.Artboard.prototype.draw=function(u){u.td?u.td.push(h.bind(this,u.pe)):h.call(this,u)};const n=new da,p=new da,q=new ca;Rive.requestAnimationFrame=q.requestAnimationFrame.bind(q);Rive.cancelAnimationFrame=q.cancelAnimationFrame.bind(q);Rive.enableFPSCounter=q.ve.bind(q);q.he=c;const x=k.WebGLRenderer.prototype.clear;k.WebGLRenderer.prototype.clear=function(){m=
|
|
20
20
|
fa[this.ne];k.re=r=m&&m.Td;const u=this.od;if(this.be!=u.width||this.ae!=u.height)this.resize(u.width,u.height),this.be=u.width,this.ae=u.height;x.call(this)}};var ia={},ja;for(ja in k)k.hasOwnProperty(ja)&&(ia[ja]=k[ja]);var ka="./this.program",la="object"===typeof window,ma="function"===typeof importScripts,na="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node,w="",oa,pa,qa,ra,sa;
|
|
21
21
|
if(na)w=ma?require("path").dirname(w)+"/":__dirname+"/",oa=function(a,b){ra||(ra=require("fs"));sa||(sa=require("path"));a=sa.normalize(a);return ra.readFileSync(a,b?null:"utf8")},qa=function(a){a=oa(a,!0);a.buffer||(a=new Uint8Array(a));a.buffer||ta("Assertion failed: undefined");return a},pa=function(a,b,c){ra||(ra=require("fs"));sa||(sa=require("path"));a=sa.normalize(a);ra.readFile(a,function(d,e){d?c(d):b(e.buffer)})},1<process.argv.length&&(ka=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),
|