File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 3232
3333 if ( JSROOT . gStyle . NoWebGL ) return false ;
3434
35- return ( function ( ) {
36- try {
37- return ! ! window . WebGLRenderingContext &&
38- ! ! document . createElement ( 'canvas' ) . getContext ( 'experimental-webgl' ) ;
39- } catch ( e ) {
40- return false ;
41- }
42- } ) ( ) ;
35+ if ( '_Detect_WebGL' in this ) return this . _Detect_WebGL ;
36+
37+ try {
38+ var canvas = document . createElement ( 'canvas' ) ;
39+ this . _Detect_WebGL = ! ! ( window . WebGLRenderingContext && ( canvas . getContext ( 'webgl' ) || canvas . getContext ( 'experimental-webgl' ) ) ) ;
40+ //res = !!window.WebGLRenderingContext && !!document.createElement('canvas').getContext('experimental-webgl');
41+ } catch ( e ) {
42+ return false ;
43+ }
44+
45+ return this . _Detect_WebGL ;
4346 }
4447
4548 JSROOT . Painter . add3DInteraction = function ( ) {
You can’t perform that action at this time.
0 commit comments