UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

2 lines 745 B
import{log as e}from"../../util/internals/console.min.mjs";import{GLProbe as t}from"./GLProbe.min.mjs";var n=class extends t{testPrecision(e,t){let n=`precision ${t} float;\nvoid main(){}`,r=e.createShader(e.FRAGMENT_SHADER);return!!r&&(e.shaderSource(r,n),e.compileShader(r),!!e.getShaderParameter(r,e.COMPILE_STATUS))}queryWebGL(t){let n=t.getContext(`webgl`);n&&(this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),this.GLPrecision=[`highp`,`mediump`,`lowp`].find(e=>this.testPrecision(n,e)),n.getExtension(`WEBGL_lose_context`).loseContext(),e(`log`,`WebGL: max texture size ${this.maxTextureSize}`))}isSupported(e){return!!this.maxTextureSize&&this.maxTextureSize>=e}};export{n as WebGLProbe}; //# sourceMappingURL=WebGLProbe.min.mjs.map