mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
clean up code from testing the MAX_TEXTURE_IMAGE_UNITS error issue
This commit is contained in:
parent
a2d31e9610
commit
43de595c24
@ -90,12 +90,6 @@
|
|||||||
|
|
||||||
this.context = this._outputContext; // API required by tests
|
this.context = this._outputContext; // API required by tests
|
||||||
|
|
||||||
// for use with qunit tests
|
|
||||||
this._numGlMaxTextureErrors = 0;
|
|
||||||
this._numGlMaxTextureOks = 0;
|
|
||||||
|
|
||||||
console.log('WebGLDrawer created');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public API required by all Drawer implementations
|
// Public API required by all Drawer implementations
|
||||||
@ -281,13 +275,13 @@
|
|||||||
|
|
||||||
let maxTextures = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS);
|
let maxTextures = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS);
|
||||||
if(maxTextures <= 0){
|
if(maxTextures <= 0){
|
||||||
this._numGlMaxTextureErrors += 1;
|
// This can apparently happen on some systems if too many WebGL contexts have been created
|
||||||
$.console.error(`There was a WebGL problem: bad value for MAX_TEXTURE_IMAGE_UNITS (${maxTextures})`);
|
// in which case maxTextures can be null, leading to out of bounds errors with the array
|
||||||
console.error(`There was a WebGL problem: bad value for MAX_TEXTURE_IMAGE_UNITS (${maxTextures}), total errors = ${this._numGlMaxTextureErrors}`);
|
// use plain console.error instead of $.console.error in order to have the message show up in the test log.
|
||||||
|
console.error(`There was a WebGL problem: bad value for MAX_TEXTURE_IMAGE_UNITS (${maxTextures})`);
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
this._numGlMaxTextureOks += 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let texturePositionArray = new Float32Array(maxTextures * 12); // 6 vertices (2 triangles) x 2 coordinates per vertex
|
let texturePositionArray = new Float32Array(maxTextures * 12); // 6 vertices (2 triangles) x 2 coordinates per vertex
|
||||||
let textureDataArray = new Array(maxTextures);
|
let textureDataArray = new Array(maxTextures);
|
||||||
let matrixArray = new Array(maxTextures);
|
let matrixArray = new Array(maxTextures);
|
||||||
|
@ -147,19 +147,6 @@
|
|||||||
assert.equal(called, true, 'called through for ' + member0);
|
assert.equal(called, true, 'called through for ' + member0);
|
||||||
assert.equal(errored, true, 'errored for ' + member0);
|
assert.equal(errored, true, 'errored for ' + member0);
|
||||||
},
|
},
|
||||||
|
|
||||||
logWebGLInfo: function(viewer){
|
|
||||||
let drawers = [viewer.drawer, viewer.navigator && viewer.navigator.drawer];
|
|
||||||
for(const drawer of drawers){
|
|
||||||
if(!drawer){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let errors = drawer._numGlMaxTextureErrors;
|
|
||||||
let ok = drawer._numGlMaxTextureErrors;
|
|
||||||
errors === 0 ? console.log('No GL errors') : errors ? console.log(`GL errors: ${errors}`) : null;
|
|
||||||
ok === 0 ? console.log('No GL calls') : ok ? console.log(`GL calls: ${ok}`) : null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
},
|
},
|
||||||
afterEach: function () {
|
afterEach: function () {
|
||||||
if (viewer){
|
if (viewer){
|
||||||
// Util.logWebGLInfo(viewer);
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +81,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (viewer){
|
if (viewer){
|
||||||
// Util.logWebGLInfo(viewer);
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
viewerConfig[config.property] = level;
|
viewerConfig[config.property] = level;
|
||||||
@ -103,7 +101,6 @@
|
|||||||
viewerConfig[config.property] = level;
|
viewerConfig[config.property] = level;
|
||||||
|
|
||||||
if (viewer){
|
if (viewer){
|
||||||
// Util.logWebGLInfo(viewer);
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
viewer = OpenSeadragon(viewerConfig);
|
viewer = OpenSeadragon(viewerConfig);
|
||||||
@ -383,7 +380,6 @@
|
|||||||
i++;
|
i++;
|
||||||
if (i < testZoomLevels.length) {
|
if (i < testZoomLevels.length) {
|
||||||
if (viewer){
|
if (viewer){
|
||||||
// Util.logWebGLInfo(viewer);
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
viewer = OpenSeadragon({
|
viewer = OpenSeadragon({
|
||||||
@ -400,7 +396,6 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (viewer){
|
if (viewer){
|
||||||
// Util.logWebGLInfo(viewer);
|
|
||||||
viewer.destroy();
|
viewer.destroy();
|
||||||
}
|
}
|
||||||
viewer = OpenSeadragon({
|
viewer = OpenSeadragon({
|
||||||
|
Loading…
Reference in New Issue
Block a user