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

Function makeLostContextFunctionWrapper

docs/tests/v2/es6/js/sanddance.js:34974–34989  ·  view source on GitHub ↗
(ctx, functionName)

Source from the content-addressed store, hash-verified

34972
34973 // Makes a function that simulates WebGL when out of context.
34974 function makeLostContextFunctionWrapper(ctx, functionName) {
34975 var f = ctx[functionName];
34976 return function() {
34977 // log("calling:" + functionName);
34978 // Only call the functions if the context is not lost.
34979 loseContextIfTime();
34980 if (!contextLost_) {
34981 //if (!checkResources(arguments)) {
34982 // glErrorShadow_[wrappedContext_.INVALID_OPERATION] = true;
34983 // return;
34984 //}
34985 var result = f.apply(ctx, arguments);
34986 return result;
34987 }
34988 };
34989 }
34990
34991 function freeResources() {
34992 for (var ii = 0; ii < resourceDb_.length; ++ii) {

Callers 1

Calls 1

loseContextIfTimeFunction · 0.85

Tested by

no test coverage detected