Skip to content

Commit 4b61e90

Browse files
authored
Merge pull request #730 from atom-minimap/dsyncronized-canvas-feat-detect
2 parents df177d8 + 7b3e51e commit 4b61e90

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/canvas-layer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ module.exports = class CanvasLayer {
1010
* @type {HTMLCanvasElement}
1111
*/
1212
this.canvas = document.createElement('canvas')
13+
14+
const desynchronized = process.platform !== "linux"
15+
const lowLatency = desynchronized
16+
1317
/**
1418
* The onscreen canvas context.
1519
* @type {CanvasRenderingContext2D}
1620
*/
17-
this.context = this.canvas.getContext('2d', { desynchronized: true })
21+
this.context = this.canvas.getContext('2d', { desynchronized: desynchronized, lowLatency: lowLatency })
1822
this.canvas.webkitImageSmoothingEnabled = false
1923
this.context.imageSmoothingEnabled = false
2024

@@ -29,7 +33,7 @@ module.exports = class CanvasLayer {
2933
* @type {CanvasRenderingContext2D}
3034
* @access private
3135
*/
32-
this.offscreenContext = this.offscreenCanvas.getContext('2d', { desynchronized: true })
36+
this.offscreenContext = this.offscreenCanvas.getContext('2d', { desynchronized: desynchronized, lowLatency: lowLatency })
3337
this.offscreenCanvas.webkitImageSmoothingEnabled = false
3438
this.offscreenContext.imageSmoothingEnabled = false
3539
}

0 commit comments

Comments
 (0)