fabric
Version:
Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.
2 lines • 692 B
JavaScript
import{getFabricWindow as e}from"../env/index.min.mjs";import{createCanvasElement as t,createCanvasElementFor as n}from"../util/misc/dom.min.mjs";import{WebGLFilterBackend as r}from"./WebGLFilterBackend.min.mjs";const i=e=>e.webgl!==void 0,a=(i,a)=>{let o=n({width:i,height:a}),s=t().getContext(`webgl`),c={imageBuffer:new ArrayBuffer(i*a*4)},l={destinationWidth:i,destinationHeight:a,targetCanvas:o},u;u=e().performance.now(),r.prototype.copyGLTo2D.call(c,s,l);let d=e().performance.now()-u;return u=e().performance.now(),r.prototype.copyGLTo2DPutImageData.call(c,s,l),d>e().performance.now()-u};export{a as isPutImageFaster,i as isWebGLPipelineState};
//# sourceMappingURL=utils.min.mjs.map