WebGLDriverTest.js 1.4 KB

12345
  1. /*
  2. All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. See https://js.arcgis.com/4.25/esri/copyright.txt for details.
  4. */
  5. import{isNone as e}from"../../core/maybe.js";import{testDoublePrecisionArithmetic as t}from"./testDoublePrecisionArithmetic.js";import{testFloatBufferBlend as i}from"./testFloatBufferBlend.js";import{testSamplerPrecision as r}from"./testSamplerPrecision.js";import{testSVGPremultipliedAlpha as s}from"./testSVGPremultipliedAlpha.js";class o{constructor(e){this.context=e,this._floatBufferBlendWorking=i(e),s(e).then((e=>this._svgAlwaysPremultipliesAlpha=!e))}get floatBufferBlendWorking(){if(e(this._floatBufferBlendWorking))throw new Error("floatBufferBlendWorking test not yet available");return this._floatBufferBlendWorking}get svgAlwaysPremultipliesAlpha(){if(e(this._svgAlwaysPremultipliesAlpha))throw new Error("svgAlwaysPremultipliesAlpha test not yet available");return this._svgAlwaysPremultipliesAlpha}get doublePrecisionRequiresObfuscation(){if(e(this._doublePrecisionRequiresObfuscation)){const e=t(this.context,!1),i=t(this.context,!0);this._doublePrecisionRequiresObfuscation=0!==e&&(0===i||e/i>5)}return this._doublePrecisionRequiresObfuscation}get ignoresSamplerPrecision(){return e(this._ignoresSamplerPrecision)&&(this._ignoresSamplerPrecision=r(this.context)),this._ignoresSamplerPrecision}}export{o as WebGLDriverTest};