()
| 56 | } |
| 57 | |
| 58 | static setupFeatureChecks() { |
| 59 | if (typeof document !== 'undefined') { |
| 60 | testCanvas = document.createElement('canvas'); |
| 61 | } else if (typeof OffscreenCanvas !== 'undefined') { |
| 62 | testCanvas = new OffscreenCanvas(0, 0); |
| 63 | } |
| 64 | if (!testCanvas) return; |
| 65 | testContext = testCanvas.getContext('webgl') || testCanvas.getContext('experimental-webgl'); |
| 66 | if (!testContext || !testContext.getExtension) return; |
| 67 | testExtensions = { |
| 68 | OES_texture_float: testContext.getExtension('OES_texture_float'), |
| 69 | OES_texture_float_linear: testContext.getExtension('OES_texture_float_linear'), |
| 70 | OES_element_index_uint: testContext.getExtension('OES_element_index_uint'), |
| 71 | WEBGL_draw_buffers: testContext.getExtension('WEBGL_draw_buffers'), |
| 72 | }; |
| 73 | features = this.getFeatures(); |
| 74 | } |
| 75 | |
| 76 | static isContextMatch(context) { |
| 77 | if (typeof WebGLRenderingContext !== 'undefined') { |
no test coverage detected