From da1e3b40cca8017d3d311f57a7e1edc1032b359c Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 4 Sep 2017 12:59:59 -0700 Subject: [PATCH] Don't use ImageBitmap on Firefox --- src/renderer/CharAtlas.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderer/CharAtlas.ts b/src/renderer/CharAtlas.ts index 05eb9a84..e2562873 100644 --- a/src/renderer/CharAtlas.ts +++ b/src/renderer/CharAtlas.ts @@ -1,5 +1,6 @@ import { ITerminal, ITheme } from '../Interfaces'; import { IColorSet } from '../renderer/Interfaces'; +import { isFirefox } from '../utils/Browser'; export const CHAR_ATLAS_CELL_SPACING = 1; @@ -152,8 +153,10 @@ class CharAtlasGenerator { const charAtlasImageData = this._ctx.getImageData(0, 0, this._canvas.width, this._canvas.height); // Support is patchy for createImageBitmap at the moment, pass a canvas back - // if support is lacking as drawImage works there too. - if (!('createImageBitmap' in window)) { + // if support is lacking as drawImage works there too. Firefox is also + // included here as ImageBitmap appears both buggy and has horrible + // performance (tested on v55). + if (!('createImageBitmap' in window) || isFirefox) { // Regenerate canvas and context as they are now owned by the char atlas const result = this._canvas; this._canvas = this._document.createElement('canvas');