avoid costly webgl test
jdalton opened this issue · 3 comments
Over on has.js we had a costly webgl test too, but some Chrome devs gave us a heads-up that a simpler test would require less spin up than
document.createElement( 'canvas' ).getContext( 'experimental-webgl' )
.
Instead you could check for the existence/type of window.WebGLRenderingContext
.
It's already doing that. First it checks for WebGLRenderingContext
. If it doesn't exist it doesn't try the rest. The real test for WebGL includes drawing with a color on the context and doing a readPixel. A bit too much for now.
It's already doing that.
Right, I'm saying for perf reasons the full feature test isn't needed, instead only prop inference should be required.
See this for more details.
True, removing the getContext stuff makes the whole System init go from ~50ms to ~5ms. Hmmm, I'll need to think about this...