From e307579d49ed3986926327802c79aab710acef7f Mon Sep 17 00:00:00 2001 From: tsauerwein Date: Mon, 24 Nov 2014 09:42:10 +0100 Subject: [PATCH] Move constants from `ol.has` to `ol` --- examples/symbol-atlas-webgl.js | 2 +- src/ol/has.js | 22 ++-------------------- src/ol/ol.js | 18 ++++++++++++++++++ src/ol/webgl/context.js | 3 +-- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/examples/symbol-atlas-webgl.js b/examples/symbol-atlas-webgl.js index 63dd568bb3..4b1ece67f7 100644 --- a/examples/symbol-atlas-webgl.js +++ b/examples/symbol-atlas-webgl.js @@ -15,7 +15,7 @@ var atlasManager = new ol.style.AtlasManager({ // we increase the default size so that all symbols fit into // a single atlas image size: 512, - maxSize: ol.has.WEBGL_MAX_TEXTURE_SIZE + maxSize: ol.WEBGL_MAX_TEXTURE_SIZE }); var symbolInfo = [{ diff --git a/src/ol/has.js b/src/ol/has.js index 720977cef4..f86249f976 100644 --- a/src/ol/has.js +++ b/src/ol/has.js @@ -122,24 +122,6 @@ ol.has.MSPOINTER = !!(goog.global.navigator.msPointerEnabled); ol.has.WEBGL; -/** - * The maximum supported WebGL texture size in pixels. If WebGL is not - * supported, the value is set to `undefined`. - * @const - * @type {number|undefined} - * @api - */ -ol.has.WEBGL_MAX_TEXTURE_SIZE; - - -/** - * List of supported WebGL extensions. - * @const - * @type {Array.} - */ -ol.has.WEBGL_EXTENSIONS; - - (function() { if (ol.ENABLE_WEBGL) { var hasWebGL = false; @@ -162,7 +144,7 @@ ol.has.WEBGL_EXTENSIONS; } catch (e) {} } ol.has.WEBGL = hasWebGL; - ol.has.WEBGL_MAX_TEXTURE_SIZE = textureSize; - ol.has.WEBGL_EXTENSIONS = extensions; + ol.WEBGL_EXTENSIONS = extensions; + ol.WEBGL_MAX_TEXTURE_SIZE = textureSize; } })(); diff --git a/src/ol/ol.js b/src/ol/ol.js index 6e0968f9d3..02c1f30ec1 100644 --- a/src/ol/ol.js +++ b/src/ol/ol.js @@ -219,6 +219,24 @@ ol.SIMPLIFY_TOLERANCE = 0.5; ol.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK = 1024; +/** + * The maximum supported WebGL texture size in pixels. If WebGL is not + * supported, the value is set to `undefined`. + * @const + * @type {number|undefined} + * @api + */ +ol.WEBGL_MAX_TEXTURE_SIZE; // value is set in `ol.has` + + +/** + * List of supported WebGL extensions. + * @const + * @type {Array.} + */ +ol.WEBGL_EXTENSIONS; // value is set in `ol.has` + + /** * @define {number} Zoom slider animation duration. */ diff --git a/src/ol/webgl/context.js b/src/ol/webgl/context.js index cacb9aeb5f..50403e2341 100644 --- a/src/ol/webgl/context.js +++ b/src/ol/webgl/context.js @@ -5,7 +5,6 @@ goog.require('goog.asserts'); goog.require('goog.events'); goog.require('goog.log'); goog.require('goog.object'); -goog.require('ol.has'); goog.require('ol.webgl.Buffer'); goog.require('ol.webgl.WebGLContextEventType'); @@ -70,7 +69,7 @@ ol.webgl.Context = function(canvas, gl) { * @type {boolean} */ this.hasOESElementIndexUint = goog.array.contains( - ol.has.WEBGL_EXTENSIONS, 'OES_element_index_uint'); + ol.WEBGL_EXTENSIONS, 'OES_element_index_uint'); // use the OES_element_index_uint extension if available if (this.hasOESElementIndexUint) {