Ignore noisy webgl params (#1016)
* `isContextLost` is particularly noisy, being called almost constantly by e.g. Figma to check whether there's a need to re initialize a canvas
Juice10: We could perhaps look at 5cd49f6cbc/lib/lib.dom.d.ts (L14578) via https://stackoverflow.com/questions/60150251/how-to-import-an-interface-from-lib-dom-d-ts
* Apply formatting changes
Co-authored-by: eoghanmurray <eoghanmurray@users.noreply.github.com>
This commit is contained in:
@@ -24,6 +24,18 @@ function patchGLPrototype(
|
|||||||
const props = Object.getOwnPropertyNames(prototype);
|
const props = Object.getOwnPropertyNames(prototype);
|
||||||
|
|
||||||
for (const prop of props) {
|
for (const prop of props) {
|
||||||
|
if (
|
||||||
|
//prop.startsWith('get') || // e.g. getProgramParameter, but too risky
|
||||||
|
[
|
||||||
|
'isContextLost',
|
||||||
|
'canvas',
|
||||||
|
'drawingBufferWidth',
|
||||||
|
'drawingBufferHeight',
|
||||||
|
].includes(prop)
|
||||||
|
) {
|
||||||
|
// skip read only propery/functions
|
||||||
|
continue;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (typeof prototype[prop as keyof typeof prototype] !== 'function') {
|
if (typeof prototype[prop as keyof typeof prototype] !== 'function') {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user