Loading
Bug 1777849 - Don't attempt to recreate DrawTargetWebgl's SharedContext again...
Bug 1777849 - Don't attempt to recreate DrawTargetWebgl's SharedContext again if WebGL initialization fails. r=ahale If the user does not actually support WebGL 2, attempting to create a DrawTargetWebgl will always fail. However, each time it goes to create a DrawTargetWebgl, it will try to initialize a WebGL 2 context again. Each time it does this, if the user is using GLX, it will call XCreatePixmap and glXCreateContextAttribs, which can run afoul of a libX11 race condition. This will happen on every page load where a new canvas is encountered. It would be better to note that the failure is non-recoverable and not try to use DrawTargetWebgl on subsequent attempts. Here we set the sContextInitError value to indicate there are non-recoverable errors, after which it will bypass attempting creation the next time. This means the worst exposure the user will have to the libX11 race condition is once per process lifetime, which should greatly reduce the incidence. Differential Revision: https://phabricator.services.mozilla.com/D171016