Move WebGL support test into ol.webgl
This commit is contained in:
@@ -19,3 +19,19 @@ ol.webgl.WebGLContextEventType = {
|
||||
ol.webgl.getContext = function(canvas, opt_attributes) {
|
||||
return canvas.getContext('experimental-webgl', opt_attributes);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} Is supported.
|
||||
*/
|
||||
ol.webgl.isSupported = function() {
|
||||
if (!('WebGLRenderingContext' in goog.global)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
var canvas = goog.dom.createElement(goog.dom.TagName.CANVAS);
|
||||
return !goog.isNull(canvas.getContext('experimental-webgl'));
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user