Remove ol.DEBUG

This commit is contained in:
Tim Schaub
2016-12-29 09:09:24 -07:00
parent 7b9690a691
commit 137cdc04c8
128 changed files with 309 additions and 2027 deletions

View File

@@ -82,9 +82,7 @@ ol.webgl.Context = function(canvas, gl) {
// use the OES_element_index_uint extension if available
if (this.hasOESElementIndexUint) {
var ext = gl.getExtension('OES_element_index_uint');
ol.DEBUG && console.assert(ext,
'Failed to get extension "OES_element_index_uint"');
gl.getExtension('OES_element_index_uint');
}
ol.events.listen(this.canvas_, ol.webgl.ContextEventType.LOST,
@@ -113,9 +111,6 @@ ol.webgl.Context.prototype.bindBuffer = function(target, buf) {
} else {
var buffer = gl.createBuffer();
gl.bindBuffer(target, buffer);
ol.DEBUG && console.assert(target == ol.webgl.ARRAY_BUFFER ||
target == ol.webgl.ELEMENT_ARRAY_BUFFER,
'target is supposed to be an ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER');
var /** @type {ArrayBufferView} */ arrayBuffer;
if (target == ol.webgl.ARRAY_BUFFER) {
arrayBuffer = new Float32Array(arr);
@@ -138,8 +133,6 @@ ol.webgl.Context.prototype.bindBuffer = function(target, buf) {
ol.webgl.Context.prototype.deleteBuffer = function(buf) {
var gl = this.getGL();
var bufferKey = String(ol.getUid(buf));
ol.DEBUG && console.assert(bufferKey in this.bufferCache_,
'attempted to delete uncached buffer');
var bufferCacheEntry = this.bufferCache_[bufferKey];
if (!gl.isContextLost()) {
gl.deleteBuffer(bufferCacheEntry.buffer);
@@ -218,10 +211,6 @@ ol.webgl.Context.prototype.getShader = function(shaderObject) {
var shader = gl.createShader(shaderObject.getType());
gl.shaderSource(shader, shaderObject.getSource());
gl.compileShader(shader);
ol.DEBUG && console.assert(
gl.getShaderParameter(shader, ol.webgl.COMPILE_STATUS) ||
gl.isContextLost(),
gl.getShaderInfoLog(shader) || 'illegal state, shader not compiled or context lost');
this.shaderCache_[shaderKey] = shader;
return shader;
}
@@ -248,10 +237,6 @@ ol.webgl.Context.prototype.getProgram = function(
gl.attachShader(program, this.getShader(fragmentShaderObject));
gl.attachShader(program, this.getShader(vertexShaderObject));
gl.linkProgram(program);
ol.DEBUG && console.assert(
gl.getProgramParameter(program, ol.webgl.LINK_STATUS) ||
gl.isContextLost(),
gl.getProgramInfoLog(program) || 'illegal state, shader not linked or context lost');
this.programCache_[programKey] = program;
return program;
}

View File

@@ -35,9 +35,7 @@ ol.inherits({{className}}.Fragment, ol.webgl.Fragment);
* @const
* @type {string}
*/
{{className}}.Fragment.SOURCE = ol.DEBUG ?
{{className}}.Fragment.DEBUG_SOURCE :
{{className}}.Fragment.OPTIMIZED_SOURCE;
{{className}}.Fragment.SOURCE = {{className}}.Fragment.OPTIMIZED_SOURCE;
{{className}}.fragment = new {{className}}.Fragment();
@@ -72,9 +70,7 @@ ol.inherits({{className}}.Vertex, ol.webgl.Vertex);
* @const
* @type {string}
*/
{{className}}.Vertex.SOURCE = ol.DEBUG ?
{{className}}.Vertex.DEBUG_SOURCE :
{{className}}.Vertex.OPTIMIZED_SOURCE;
{{className}}.Vertex.SOURCE = {{className}}.Vertex.OPTIMIZED_SOURCE;
{{className}}.vertex = new {{className}}.Vertex();
@@ -92,15 +88,13 @@ ol.inherits({{className}}.Vertex, ol.webgl.Vertex);
/**
* @type {WebGLUniformLocation}
*/
this.{{originalName}} = gl.getUniformLocation(
program, ol.DEBUG ? '{{originalName}}' : '{{shortName}}');
this.{{originalName}} = gl.getUniformLocation(program, '{{shortName}}');
{{/getUniforms}}
{{#getAttributes}}
/**
* @type {number}
*/
this.{{originalName}} = gl.getAttribLocation(
program, ol.DEBUG ? '{{originalName}}' : '{{shortName}}');
this.{{originalName}} = gl.getAttribLocation(program, '{{shortName}}');
{{/getAttributes}}
};