From 09ff63c9ec0c4f18060185232d95e4273b293e79 Mon Sep 17 00:00:00 2001 From: bordun Date: Tue, 28 Jan 2020 23:51:25 +0100 Subject: [PATCH] canvas: don't use deprecated rendering method --- src/client/app/widgets/common/canvas.js | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/client/app/widgets/common/canvas.js b/src/client/app/widgets/common/canvas.js index e56cf7be..fb303d82 100644 --- a/src/client/app/widgets/common/canvas.js +++ b/src/client/app/widgets/common/canvas.js @@ -67,15 +67,11 @@ class Canvas extends Widget { this.canvas = DOM.get(this.widget, 'canvas')[0] - this.offscreen = this.canvas.transferControlToOffscreen ? - this.canvas.transferControlToOffscreen() : false - - this.ctx = this.offscreen ? this.offscreen.getContext('2d',{ - singleBuffered: true, - lowLatency: true, + this.ctx = this.canvas.getContext('2d',{ desynchronized: true, + lowLatency: true, alpha: true - }) : this.canvas.getContext('2d') + }) this.height = undefined this.width = undefined @@ -95,8 +91,6 @@ class Canvas extends Widget { } - if (this.offscreen) this.ctx.curve = CanvasRenderingContext2D.prototype.curve.bind(this.ctx) - } resizeHandleProxy() { @@ -116,11 +110,6 @@ class Canvas extends Widget { this.canvas.setAttribute('width', width * ratio) this.canvas.setAttribute('height', height * ratio) - if (this.offscreen) { - this.offscreen.width = width * ratio - this.offscreen.height = height * ratio - } - this.clearRect = [] if (ratio != 1) { @@ -184,11 +173,7 @@ class Canvas extends Widget { batchDraw() { if (this.visible) { - if (this.offscreen) { - this.draw() - } else { - canvasQueue.push(this) - } + canvasQueue.push(this) } }