Merge pull request #7148 from ahocevar/webgl-define

Remove ol.ENABLE_WEBGL wrap from WebGL files
This commit is contained in:
Andreas Hocevar
2017-08-17 14:39:08 -04:00
committed by GitHub
29 changed files with 7047 additions and 7157 deletions
-4
View File
@@ -3,8 +3,6 @@ goog.provide('ol.render.webgl');
goog.require('ol'); goog.require('ol');
if (ol.ENABLE_WEBGL) {
/** /**
* @const * @const
* @type {string} * @type {string}
@@ -101,5 +99,3 @@ if (ol.ENABLE_WEBGL) {
* @type {number} * @type {number}
*/ */
ol.render.webgl.EPSILON = Number.EPSILON || 2.220446049250313e-16; ol.render.webgl.EPSILON = Number.EPSILON || 2.220446049250313e-16;
}
-4
View File
@@ -13,8 +13,6 @@ goog.require('ol.webgl');
goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.Buffer');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.render.webgl.Replay} * @extends {ol.render.webgl.Replay}
@@ -420,5 +418,3 @@ if (ol.ENABLE_WEBGL) {
this.styles_.push([fillStyleColor, strokeStyleColor, strokeStyleWidth]); this.styles_.push([fillStyleColor, strokeStyleColor, strokeStyleWidth]);
} }
}; };
}
@@ -6,8 +6,6 @@ goog.require('ol');
goog.require('ol.webgl.Fragment'); goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -162,5 +160,3 @@ if (ol.ENABLE_WEBGL) {
this.a_radius = gl.getAttribLocation( this.a_radius = gl.getAttribLocation(
program, ol.DEBUG_WEBGL ? 'a_radius' : 'g'); program, ol.DEBUG_WEBGL ? 'a_radius' : 'g');
}; };
}
-4
View File
@@ -5,8 +5,6 @@ goog.require('ol.render.webgl.TextureReplay');
goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.Buffer');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.render.webgl.TextureReplay} * @extends {ol.render.webgl.TextureReplay}
@@ -169,5 +167,3 @@ if (ol.ENABLE_WEBGL) {
ol.render.webgl.ImageReplay.prototype.getHitDetectionTextures = function() { ol.render.webgl.ImageReplay.prototype.getHitDetectionTextures = function() {
return this.hitDetectionTextures_; return this.hitDetectionTextures_;
}; };
}
-4
View File
@@ -8,8 +8,6 @@ goog.require('ol.render.VectorContext');
goog.require('ol.render.webgl.ReplayGroup'); goog.require('ol.render.webgl.ReplayGroup');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.render.VectorContext} * @extends {ol.render.VectorContext}
@@ -413,5 +411,3 @@ if (ol.ENABLE_WEBGL) {
ol.render.webgl.Immediate.prototype.setTextStyle = function(textStyle) { ol.render.webgl.Immediate.prototype.setTextStyle = function(textStyle) {
this.textStyle_ = textStyle; this.textStyle_ = textStyle;
}; };
}
-4
View File
@@ -15,8 +15,6 @@ goog.require('ol.webgl');
goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.Buffer');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.render.webgl.Replay} * @extends {ol.render.webgl.Replay}
@@ -685,5 +683,3 @@ if (ol.ENABLE_WEBGL) {
MITER_BOTTOM: 19, MITER_BOTTOM: 19,
MITER_TOP: 23 MITER_TOP: 23
}; };
}
@@ -6,8 +6,6 @@ goog.require('ol');
goog.require('ol.webgl.Fragment'); goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -168,5 +166,3 @@ if (ol.ENABLE_WEBGL) {
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, ol.DEBUG_WEBGL ? 'a_position' : 'e'); program, ol.DEBUG_WEBGL ? 'a_position' : 'e');
}; };
}
-4
View File
@@ -19,8 +19,6 @@ goog.require('ol.webgl');
goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.Buffer');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.render.webgl.Replay} * @extends {ol.render.webgl.Replay}
@@ -1071,5 +1069,3 @@ if (ol.ENABLE_WEBGL) {
this.lineStringReplay.setFillStrokeStyle(null, nullStrokeStyle); this.lineStringReplay.setFillStrokeStyle(null, nullStrokeStyle);
} }
}; };
}
@@ -6,8 +6,6 @@ goog.require('ol');
goog.require('ol.webgl.Fragment'); goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -126,5 +124,3 @@ if (ol.ENABLE_WEBGL) {
this.a_position = gl.getAttribLocation( this.a_position = gl.getAttribLocation(
program, ol.DEBUG_WEBGL ? 'a_position' : 'a'); program, ol.DEBUG_WEBGL ? 'a_position' : 'a');
}; };
}
-4
View File
@@ -8,8 +8,6 @@ goog.require('ol.vec.Mat4');
goog.require('ol.webgl'); goog.require('ol.webgl');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @abstract * @abstract
@@ -361,5 +359,3 @@ if (ol.ENABLE_WEBGL) {
var offsetInBytes = start * elementSize; var offsetInBytes = start * elementSize;
gl.drawElements(ol.webgl.TRIANGLES, numItems, elementType, offsetInBytes); gl.drawElements(ol.webgl.TRIANGLES, numItems, elementType, offsetInBytes);
}; };
}
-4
View File
@@ -13,8 +13,6 @@ goog.require('ol.render.webgl.PolygonReplay');
goog.require('ol.render.webgl.TextReplay'); goog.require('ol.render.webgl.TextReplay');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.render.ReplayGroup} * @extends {ol.render.ReplayGroup}
@@ -321,5 +319,3 @@ if (ol.ENABLE_WEBGL) {
'Polygon': ol.render.webgl.PolygonReplay, 'Polygon': ol.render.webgl.PolygonReplay,
'Text': ol.render.webgl.TextReplay 'Text': ol.render.webgl.TextReplay
}; };
}
-4
View File
@@ -10,8 +10,6 @@ goog.require('ol.style.AtlasManager');
goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.Buffer');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.render.webgl.TextureReplay} * @extends {ol.render.webgl.TextureReplay}
@@ -451,5 +449,3 @@ if (ol.ENABLE_WEBGL) {
ideographic: 0.8, ideographic: 0.8,
bottom: 1 bottom: 1
}; };
}
-3
View File
@@ -8,8 +8,6 @@ goog.require('ol.render.webgl.Replay');
goog.require('ol.webgl'); goog.require('ol.webgl');
goog.require('ol.webgl.Context'); goog.require('ol.webgl.Context');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @abstract * @abstract
@@ -494,4 +492,3 @@ if (ol.ENABLE_WEBGL) {
* @returns {Array.<WebGLTexture>} Textures. * @returns {Array.<WebGLTexture>} Textures.
*/ */
ol.render.webgl.TextureReplay.prototype.getHitDetectionTextures = function() {}; ol.render.webgl.TextureReplay.prototype.getHitDetectionTextures = function() {};
}
@@ -6,8 +6,6 @@ goog.require('ol');
goog.require('ol.webgl.Fragment'); goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -150,5 +148,3 @@ if (ol.ENABLE_WEBGL) {
this.a_texCoord = gl.getAttribLocation( this.a_texCoord = gl.getAttribLocation(
program, ol.DEBUG_WEBGL ? 'a_texCoord' : 'd'); program, ol.DEBUG_WEBGL ? 'a_texCoord' : 'd');
}; };
}
@@ -6,8 +6,6 @@ goog.require('ol');
goog.require('ol.webgl.Fragment'); goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -126,5 +124,3 @@ if (ol.ENABLE_WEBGL) {
this.a_texCoord = gl.getAttribLocation( this.a_texCoord = gl.getAttribLocation(
program, ol.DEBUG_WEBGL ? 'a_texCoord' : 'c'); program, ol.DEBUG_WEBGL ? 'a_texCoord' : 'c');
}; };
}
-4
View File
@@ -14,8 +14,6 @@ goog.require('ol.webgl');
goog.require('ol.webgl.Context'); goog.require('ol.webgl.Context');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.renderer.webgl.Layer} * @extends {ol.renderer.webgl.Layer}
@@ -333,5 +331,3 @@ if (ol.ENABLE_WEBGL) {
return transform; return transform;
}; };
}
-4
View File
@@ -13,8 +13,6 @@ goog.require('ol.webgl.Buffer');
goog.require('ol.webgl.Context'); goog.require('ol.webgl.Context');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @abstract * @abstract
@@ -268,5 +266,3 @@ if (ol.ENABLE_WEBGL) {
* @template S,T,U * @template S,T,U
*/ */
ol.renderer.webgl.Layer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) {}; ol.renderer.webgl.Layer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) {};
}
-4
View File
@@ -22,8 +22,6 @@ goog.require('ol.webgl.Context');
goog.require('ol.webgl.ContextEventType'); goog.require('ol.webgl.ContextEventType');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.renderer.Map} * @extends {ol.renderer.Map}
@@ -595,5 +593,3 @@ if (ol.ENABLE_WEBGL) {
} }
return undefined; return undefined;
}; };
}
-4
View File
@@ -19,8 +19,6 @@ goog.require('ol.webgl');
goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.Buffer');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.renderer.webgl.Layer} * @extends {ol.renderer.webgl.Layer}
@@ -409,5 +407,3 @@ if (ol.ENABLE_WEBGL) {
return undefined; return undefined;
} }
}; };
}
-4
View File
@@ -6,8 +6,6 @@ goog.require('ol');
goog.require('ol.webgl.Fragment'); goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -114,5 +112,3 @@ if (ol.ENABLE_WEBGL) {
this.a_texCoord = gl.getAttribLocation( this.a_texCoord = gl.getAttribLocation(
program, ol.DEBUG_WEBGL ? 'a_texCoord' : 'c'); program, ol.DEBUG_WEBGL ? 'a_texCoord' : 'c');
}; };
}
-4
View File
@@ -11,8 +11,6 @@ goog.require('ol.renderer.webgl.Layer');
goog.require('ol.transform'); goog.require('ol.transform');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.renderer.webgl.Layer} * @extends {ol.renderer.webgl.Layer}
@@ -343,5 +341,3 @@ if (ol.ENABLE_WEBGL) {
} }
return loading; return loading;
}; };
}
-4
View File
@@ -3,8 +3,6 @@ goog.provide('ol.webgl');
goog.require('ol'); goog.require('ol');
if (ol.ENABLE_WEBGL) {
/** Constants taken from goog.webgl /** Constants taken from goog.webgl
*/ */
@@ -290,5 +288,3 @@ if (ol.ENABLE_WEBGL) {
} }
return null; return null;
}; };
}
-4
View File
@@ -4,8 +4,6 @@ goog.require('ol');
goog.require('ol.webgl'); goog.require('ol.webgl');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @param {Array.<number>=} opt_arr Array. * @param {Array.<number>=} opt_arr Array.
@@ -55,5 +53,3 @@ if (ol.ENABLE_WEBGL) {
STREAM_DRAW: ol.webgl.STREAM_DRAW, STREAM_DRAW: ol.webgl.STREAM_DRAW,
DYNAMIC_DRAW: ol.webgl.DYNAMIC_DRAW DYNAMIC_DRAW: ol.webgl.DYNAMIC_DRAW
}; };
}
-4
View File
@@ -9,8 +9,6 @@ goog.require('ol.webgl');
goog.require('ol.webgl.ContextEventType'); goog.require('ol.webgl.ContextEventType');
if (ol.ENABLE_WEBGL) {
/** /**
* @classdesc * @classdesc
* A WebGL context for accessing low-level WebGL capabilities. * A WebGL context for accessing low-level WebGL capabilities.
@@ -371,5 +369,3 @@ if (ol.ENABLE_WEBGL) {
return texture; return texture;
}; };
}
-4
View File
@@ -5,8 +5,6 @@ goog.require('ol.webgl');
goog.require('ol.webgl.Shader'); goog.require('ol.webgl.Shader');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Shader} * @extends {ol.webgl.Shader}
@@ -25,5 +23,3 @@ if (ol.ENABLE_WEBGL) {
ol.webgl.Fragment.prototype.getType = function() { ol.webgl.Fragment.prototype.getType = function() {
return ol.webgl.FRAGMENT_SHADER; return ol.webgl.FRAGMENT_SHADER;
}; };
}
-4
View File
@@ -4,8 +4,6 @@ goog.require('ol');
goog.require('ol.functions'); goog.require('ol.functions');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @abstract * @abstract
@@ -42,5 +40,3 @@ if (ol.ENABLE_WEBGL) {
* @return {boolean} Is animated? * @return {boolean} Is animated?
*/ */
ol.webgl.Shader.prototype.isAnimated = ol.functions.FALSE; ol.webgl.Shader.prototype.isAnimated = ol.functions.FALSE;
}
-4
View File
@@ -6,8 +6,6 @@ goog.require('ol');
goog.require('ol.webgl.Fragment'); goog.require('ol.webgl.Fragment');
goog.require('ol.webgl.Vertex'); goog.require('ol.webgl.Vertex');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Fragment} * @extends {ol.webgl.Fragment}
@@ -106,5 +104,3 @@ if (ol.ENABLE_WEBGL) {
program, ol.DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}'); program, ol.DEBUG_WEBGL ? '{{originalName}}' : '{{shortName}}');
{{/getAttributes}} {{/getAttributes}}
}; };
}
-4
View File
@@ -5,8 +5,6 @@ goog.require('ol.webgl');
goog.require('ol.webgl.Shader'); goog.require('ol.webgl.Shader');
if (ol.ENABLE_WEBGL) {
/** /**
* @constructor * @constructor
* @extends {ol.webgl.Shader} * @extends {ol.webgl.Shader}
@@ -25,5 +23,3 @@ if (ol.ENABLE_WEBGL) {
ol.webgl.Vertex.prototype.getType = function() { ol.webgl.Vertex.prototype.getType = function() {
return ol.webgl.VERTEX_SHADER; return ol.webgl.VERTEX_SHADER;
}; };
}
+2 -1
View File
@@ -2,7 +2,8 @@ const parentPackage = require('../package.json');
const thisPackage = require('../package/package.json'); const thisPackage = require('../package/package.json');
const defines = { const defines = {
'ol.ENABLE_WEBGL': false // Compiler defines go here, e.g.
// 'ol.ENABLE_WEBGL': false
}; };
function rename(name) { function rename(name) {