Don't use WebGL if there is a major performance caveat

This commit is contained in:
Tom Payne
2013-12-04 11:58:05 +01:00
parent 10db521898
commit d6dc1a2c6f
2 changed files with 4 additions and 1 deletions

View File

@@ -88,6 +88,7 @@ ol.renderer.webgl.Map = function(container, map) {
this.gl_ = ol.webgl.getContext(this.canvas_, {
antialias: true,
depth: false,
failIfMajorPerformanceCaveat: true,
preserveDrawingBuffer: false,
stencil: false
});

View File

@@ -59,7 +59,9 @@ ol.webgl.SUPPORTED = (function() {
try {
var canvas = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS));
return !goog.isNull(ol.webgl.getContext(canvas));
return !goog.isNull(ol.webgl.getContext(canvas, {
failIfMajorPerformanceCaveat: true
}));
} catch (e) {
return false;
}