@luma.gl/webgl-state-tracker
Advanced tools
Comparing version 7.3.0-beta.1 to 7.3.0-beta.2
@@ -9,10 +9,10 @@ import GL_STATE_SETTERS from './webgl-function-to-parameters-table'; | ||
gl[functionName] = function get(...params) { | ||
const pname = params[0]; | ||
gl[functionName] = function get() { | ||
const pname = arguments.length <= 0 ? undefined : arguments[0]; | ||
if (!(pname in gl.state.cache)) { | ||
gl.state.cache[pname] = originalGetterFunc(...params); | ||
gl.state.cache[pname] = originalGetterFunc(...arguments); | ||
} | ||
return gl.state.enable ? gl.state.cache[pname] : originalGetterFunc(...params); | ||
return gl.state.enable ? gl.state.cache[pname] : originalGetterFunc(...arguments); | ||
}; | ||
@@ -29,3 +29,7 @@ | ||
gl[functionName] = function set(...params) { | ||
gl[functionName] = function set() { | ||
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) { | ||
params[_key] = arguments[_key]; | ||
} | ||
const { | ||
@@ -51,6 +55,7 @@ valueChanged, | ||
class GLState { | ||
constructor(gl, { | ||
copyState = false, | ||
log = () => {} | ||
} = {}) { | ||
constructor(gl) { | ||
let { | ||
copyState = false, | ||
log = () => {} | ||
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
this.gl = gl; | ||
@@ -65,3 +70,4 @@ this.stateStack = []; | ||
push(values = {}) { | ||
push() { | ||
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
this.stateStack.push({}); | ||
@@ -105,6 +111,7 @@ } | ||
export default function trackContextState(gl, { | ||
enable = true, | ||
copyState | ||
} = {}) { | ||
export default function trackContextState(gl) { | ||
let { | ||
enable = true, | ||
copyState | ||
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
assert(copyState !== undefined); | ||
@@ -111,0 +118,0 @@ |
{ | ||
"name": "@luma.gl/webgl-state-tracker", | ||
"version": "7.3.0-beta.1", | ||
"version": "7.3.0-beta.2", | ||
"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-beta.1" | ||
"@luma.gl/constants": "7.3.0-beta.2" | ||
}, | ||
"gitHead": "f04b050a0994cac705e905976fb41a419eb86f79" | ||
"gitHead": "f58d82d7793207d8d6c35e8e5a5af915ffcf2bbb" | ||
} |
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
443337
4757
+ Added@luma.gl/constants@7.3.0-beta.2(transitive)
- Removed@luma.gl/constants@7.3.0-beta.1(transitive)