Remove ol.ENABLE_WEBGL condition from webgl files

This commit is contained in:
Andreas Hocevar
2017-08-17 13:21:53 -04:00
parent aeb9d45c19
commit 5161a99925
28 changed files with 7045 additions and 7156 deletions
+92 -96
View File
@@ -6,105 +6,101 @@ goog.require('ol');
goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/**
* @constructor
* @extends {ol.webgl.Fragment}
* @struct
*/
{{className}}.Fragment = function() {
ol.webgl.Fragment.call(this, {{className}}.Fragment.SOURCE);
};
ol.inherits({{className}}.Fragment, ol.webgl.Fragment);
/**
* @const
* @type {string}
*/
{{className}}.Fragment.DEBUG_SOURCE = 'precision mediump float;\n{{{getOriginalFragmentSource}}}';
/**
* @const
* @type {string}
*/
{{className}}.Fragment.OPTIMIZED_SOURCE = 'precision mediump float;{{{getFragmentSource}}}';
/**
* @const
* @type {string}
*/
{{className}}.Fragment.SOURCE = ol.DEBUG_WEBGL ?
{{className}}.Fragment.DEBUG_SOURCE :
{{className}}.Fragment.OPTIMIZED_SOURCE;
{{className}}.fragment = new {{className}}.Fragment();
/**
* @constructor
* @extends {ol.webgl.Vertex}
* @struct
*/
{{className}}.Vertex = function() {
ol.webgl.Vertex.call(this, {{className}}.Vertex.SOURCE);
};
ol.inherits({{className}}.Vertex, ol.webgl.Vertex);
/**
* @const
* @type {string}
*/
{{className}}.Vertex.DEBUG_SOURCE = '{{{getOriginalVertexSource}}}';
/**
* @const
* @type {string}
*/
{{className}}.Vertex.OPTIMIZED_SOURCE = '{{{getVertexSource}}}';
/**
* @const
* @type {string}
*/
{{className}}.Vertex.SOURCE = ol.DEBUG_WEBGL ?
{{className}}.Vertex.DEBUG_SOURCE :
{{className}}.Vertex.OPTIMIZED_SOURCE;
{{className}}.vertex = new {{className}}.Vertex();
/**
* @constructor
* @param {WebGLRenderingContext} gl GL.
* @param {WebGLProgram} program Program.
* @struct
*/
{{namespace}}.Locations = function(gl, program) {
{{#getUniforms}}
/**
* @constructor
* @extends {ol.webgl.Fragment}
* @struct
* @type {WebGLUniformLocation}
*/
{{className}}.Fragment = function() {
ol.webgl.Fragment.call(this, {{className}}.Fragment.SOURCE);
};
ol.inherits({{className}}.Fragment, ol.webgl.Fragment);
this.{{originalName}} = gl.getUniformLocation(
program, ol.DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}');
{{/getUniforms}}
{{#getAttributes}}
/**
* @const
* @type {string}
* @type {number}
*/
{{className}}.Fragment.DEBUG_SOURCE = 'precision mediump float;\n{{{getOriginalFragmentSource}}}';
/**
* @const
* @type {string}
*/
{{className}}.Fragment.OPTIMIZED_SOURCE = 'precision mediump float;{{{getFragmentSource}}}';
/**
* @const
* @type {string}
*/
{{className}}.Fragment.SOURCE = ol.DEBUG_WEBGL ?
{{className}}.Fragment.DEBUG_SOURCE :
{{className}}.Fragment.OPTIMIZED_SOURCE;
{{className}}.fragment = new {{className}}.Fragment();
/**
* @constructor
* @extends {ol.webgl.Vertex}
* @struct
*/
{{className}}.Vertex = function() {
ol.webgl.Vertex.call(this, {{className}}.Vertex.SOURCE);
};
ol.inherits({{className}}.Vertex, ol.webgl.Vertex);
/**
* @const
* @type {string}
*/
{{className}}.Vertex.DEBUG_SOURCE = '{{{getOriginalVertexSource}}}';
/**
* @const
* @type {string}
*/
{{className}}.Vertex.OPTIMIZED_SOURCE = '{{{getVertexSource}}}';
/**
* @const
* @type {string}
*/
{{className}}.Vertex.SOURCE = ol.DEBUG_WEBGL ?
{{className}}.Vertex.DEBUG_SOURCE :
{{className}}.Vertex.OPTIMIZED_SOURCE;
{{className}}.vertex = new {{className}}.Vertex();
/**
* @constructor
* @param {WebGLRenderingContext} gl GL.
* @param {WebGLProgram} program Program.
* @struct
*/
{{namespace}}.Locations = function(gl, program) {
{{#getUniforms}}
/**
* @type {WebGLUniformLocation}
*/
this.{{originalName}} = gl.getUniformLocation(
program, ol.DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}');
{{/getUniforms}}
{{#getAttributes}}
/**
* @type {number}
*/
this.{{originalName}} = gl.getAttribLocation(
program, ol.DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}');
{{/getAttributes}}
};
}
this.{{originalName}} = gl.getAttribLocation(
program, ol.DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}');
{{/getAttributes}}
};