@luma.gl/webgl-state-tracker
Advanced tools
Comparing version 7.3.0-alpha.7 to 7.3.0-alpha.8
@@ -9,10 +9,10 @@ import GL_STATE_SETTERS from './webgl-function-to-parameters-table'; | ||
gl[functionName] = function get() { | ||
const pname = arguments.length <= 0 ? undefined : arguments[0]; | ||
gl[functionName] = function get(...params) { | ||
const pname = params[0]; | ||
if (!(pname in gl.state.cache)) { | ||
gl.state.cache[pname] = originalGetterFunc(...arguments); | ||
gl.state.cache[pname] = originalGetterFunc(...params); | ||
} | ||
return gl.state.enable ? gl.state.cache[pname] : originalGetterFunc(...arguments); | ||
return gl.state.enable ? gl.state.cache[pname] : originalGetterFunc(...params); | ||
}; | ||
@@ -29,7 +29,3 @@ | ||
gl[functionName] = function set() { | ||
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) { | ||
params[_key] = arguments[_key]; | ||
} | ||
gl[functionName] = function set(...params) { | ||
const { | ||
@@ -55,7 +51,6 @@ valueChanged, | ||
class GLState { | ||
constructor(gl) { | ||
let { | ||
copyState = false, | ||
log = () => {} | ||
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
constructor(gl, { | ||
copyState = false, | ||
log = () => {} | ||
} = {}) { | ||
this.gl = gl; | ||
@@ -70,4 +65,3 @@ this.stateStack = []; | ||
push() { | ||
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
push(values = {}) { | ||
this.stateStack.push({}); | ||
@@ -111,7 +105,6 @@ } | ||
export default function trackContextState(gl) { | ||
let { | ||
enable = true, | ||
copyState | ||
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
export default function trackContextState(gl, { | ||
enable = true, | ||
copyState | ||
} = {}) { | ||
assert(copyState !== undefined); | ||
@@ -118,0 +111,0 @@ |
{ | ||
"name": "@luma.gl/webgl-state-tracker", | ||
"version": "7.3.0-alpha.7", | ||
"version": "7.3.0-alpha.8", | ||
"description": "WebGL state manager that saves and restores WebGLRenderingContext state", | ||
@@ -31,5 +31,5 @@ "license": "MIT", | ||
"@babel/runtime": "^7.0.0", | ||
"@luma.gl/constants": "7.3.0-alpha.7" | ||
"@luma.gl/constants": "7.3.0-alpha.8" | ||
}, | ||
"gitHead": "617b66df549e06e52105ceabfa9d135d5feccdcf" | ||
"gitHead": "24536152b5552e7c7b57a35464deb5164200d090" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
442929
4751
+ Added@luma.gl/constants@7.3.0-alpha.8(transitive)
- Removed@luma.gl/constants@7.3.0-alpha.7(transitive)