diff --git a/src/webgldrawer.js b/src/webgldrawer.js index 06be335a..71e544ca 100644 --- a/src/webgldrawer.js +++ b/src/webgldrawer.js @@ -90,12 +90,6 @@ 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 @@ -281,13 +275,13 @@ let maxTextures = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS); if(maxTextures <= 0){ - this._numGlMaxTextureErrors += 1; - $.console.error(`There was a WebGL problem: bad value for MAX_TEXTURE_IMAGE_UNITS (${maxTextures})`); - console.error(`There was a WebGL problem: bad value for MAX_TEXTURE_IMAGE_UNITS (${maxTextures}), total errors = ${this._numGlMaxTextureErrors}`); + // This can apparently happen on some systems if too many WebGL contexts have been created + // in which case maxTextures can be null, leading to out of bounds errors with the array + // 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; - } else { - this._numGlMaxTextureOks += 1; } + let texturePositionArray = new Float32Array(maxTextures * 12); // 6 vertices (2 triangles) x 2 coordinates per vertex let textureDataArray = new Array(maxTextures); let matrixArray = new Array(maxTextures); diff --git a/test/helpers/test.js b/test/helpers/test.js index 69a59162..4041591d 100644 --- a/test/helpers/test.js +++ b/test/helpers/test.js @@ -147,19 +147,6 @@ assert.equal(called, true, 'called through 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; - } - } }; /* diff --git a/test/modules/viewport.js b/test/modules/viewport.js index 8fcdf21c..3ac93734 100644 --- a/test/modules/viewport.js +++ b/test/modules/viewport.js @@ -22,7 +22,6 @@ }, afterEach: function () { if (viewer){ - // Util.logWebGLInfo(viewer); viewer.destroy(); } @@ -82,7 +81,6 @@ }; if (viewer){ - // Util.logWebGLInfo(viewer); viewer.destroy(); } viewerConfig[config.property] = level; @@ -103,7 +101,6 @@ viewerConfig[config.property] = level; if (viewer){ - // Util.logWebGLInfo(viewer); viewer.destroy(); } viewer = OpenSeadragon(viewerConfig); @@ -383,7 +380,6 @@ i++; if (i < testZoomLevels.length) { if (viewer){ - // Util.logWebGLInfo(viewer); viewer.destroy(); } viewer = OpenSeadragon({ @@ -400,7 +396,6 @@ } }; if (viewer){ - // Util.logWebGLInfo(viewer); viewer.destroy(); } viewer = OpenSeadragon({