this.iOS = Modernizr.ios;
this.edge = Modernizr.edge;
this.chromeBased = Modernizr.chrome || this.edge;
- this.svgtocanvas = this.fluidbook.settings.svgToCanvas && this.IE === 0 && !(this.safari && this.macOs);
+ this.gpuInfos = this.getGPUInfos();
+ this.svgtocanvas = this.fluidbook.settings.svgToCanvas && this.IE === 0 && !(this.safari && this.macOs) && this.getGPUInfos().vendor.indexOf('intel') === -1 && this.getGPUInfos().vendor.indexOf('renderer') === -1;
this.svgtocanvg = false;// && this.svgtocanvas;
// If in node-webkit or if the index.html fluidbook is locally open in a browser
return transitions[t];
}
}
- }, checkOrientation: function () {
+ },
+
+ checkOrientation: function () {
var o = this.getOrientation();
if (o != this._orientation) {
this._orientation = o;
$(this.fluidbook).trigger('fluidbook.orientationchange');
resize();
}
- }, getOrientation: function () {
+ },
+
+ getOrientation: function () {
try {
if ((this.fluidbook.pad && this.fluidbook.pad.enabled) || this.fluidbook.mobilefirst.enabled) {
return 0;
}
return $("#op").is(':visible') ? 0 : 90;
+ },
+
+ getGPUInfos: function () {
+ var canvas = document.createElement('canvas');
+ var gl;
+ var debugInfo;
+ var vendor;
+ var renderer;
+
+ try {
+ gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
+ } catch (e) {
+ }
+
+ if (gl) {
+ debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
+ vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
+ renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
+ return {vendor: vendor.toLowerCase(), renderer: renderer.toLowerCase()};
+ }
+
+ return false;
}
}