MCPcopy Create free account
hub / github.com/microsoft/SandDance / trackContextState

Function trackContextState

docs/app/js/sanddance-app.js:60265–60285  ·  view source on GitHub ↗
(gl)

Source from the content-addressed store, hash-verified

60263 return GLState1;
60264}();
60265function trackContextState(gl) {
60266 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref2$enable = _ref2.enable, enable = _ref2$enable === void 0 ? true : _ref2$enable, copyState = _ref2.copyState;
60267 (0, _utils.assert)(copyState !== undefined);
60268 if (!gl.state) {
60269 var global_ = typeof global !== "undefined" ? global : window;
60270 if (global_.polyfillContext) global_.polyfillContext(gl);
60271 gl.state = new GLState(gl, {
60272 copyState: copyState,
60273 enable: enable
60274 });
60275 installProgramSpy(gl);
60276 for(var key in 0, _webglParameterTables.GL_HOOKED_SETTERS){
60277 var setter = (0, _webglParameterTables.GL_HOOKED_SETTERS)[key];
60278 installSetterSpy(gl, key, setter);
60279 }
60280 installGetterOverride(gl, "getParameter");
60281 installGetterOverride(gl, "isEnabled");
60282 }
60283 gl.state.enable = enable;
60284 return gl;
60285}
60286exports.default = trackContextState;
60287function pushContextState(gl) {
60288 if (!gl.state) trackContextState(gl, {

Callers 1

pushContextStateFunction · 0.70

Calls 3

installProgramSpyFunction · 0.70
installSetterSpyFunction · 0.70
installGetterOverrideFunction · 0.70

Tested by

no test coverage detected