Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@luma.gl/webgl-state-tracker
Advanced tools
WebGL state manager that saves and restores WebGLRenderingContext state
Provides WebGL context state tracking and a unified API for setting WebGL parameters
This module installs overrides on a WebGLRenderingContext
that track state changes and allow context state to be saved and restored through push and pop operations.
This is useful when combining code written in different WebGL frameworks or code bases, as each code base can make changes to the global WebGLRenderingContext state and leave it in a state that causes problems for the other code base.
yarn add @luma.gl/webgl-state-tracker
import trackContextState from '@luma.gl/webgl-state-tracker';
const gl = canvas.getContext('webgl');
trackContextState(gl);
Initialize WebGL state caching on a context. After calling this function, context state will be cached. State caching speeds up parameter access and enables pushContextState
and popContextState
to efficiently save and restore global WebGL context state.
trackContextState(gl, {enable = true, copyState} = {})
gl
(WebGLRenderingContext) - gl contextenable
(Boolean) - whether cache is being usedcopyState
whether the state cache is initialized to WebGL defaults (fast) or read from the context (slow)Remarks:
trackContextState
can be called multiple times to enable/disable state cache.copyState
-false
is fast, and yields correct results for newly created, unmodified contexts. If you are tracking a context created by an external framework, it is likely safest to use copyState
=true
to ensure the cache corresponds to the context state.Saves the current state of the context by "pushing" it onto an internal stack, enabling it to be restored later.
pushContextState(gl)
gl
(WebGLRenderingContext) - gl context
Returns: nothingRemarks:
pushContextState
is expected to be matched by a call to popContextState
at a later time.Restores the state of the context at the time of the latest call to pushContextState
.
popContextState(gl)
gl
(WebGLRenderingContext) - gl context
Returns: nothingRemarks;
pushContextState
are undone and "discarded".popContextState
without first doing a matching call to pushContextState
.7.4.0-alpha.1
FAQs
WebGL state manager that saves and restores WebGLRenderingContext state
The npm package @luma.gl/webgl-state-tracker receives a total of 2,146 weekly downloads. As such, @luma.gl/webgl-state-tracker popularity was classified as popular.
We found that @luma.gl/webgl-state-tracker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.