bp74 / StageXL

A fast and universal 2D rendering engine for HTML5 and Dart.
http://www.stagexl.org
Other
881 stars 82 forks source link

Chrome 61 context2D putImageData bug #285

Closed audioMirror closed 6 years ago

audioMirror commented 7 years ago

This is more an FYI, as it is entirely a Chrome 61 bug, and will likely be fixed by Chrome 62 release.

https://jsfiddle.net/tnawf4kj/5/

This simple fiddle shows two red images on Chrome 61 on Windows, when hardware acceleration is active. It is supposed to show a red image on the left, and a green one on the right.

This affects StageXL using a 2D context, if you use context2D.putImageData(ImageData) to fill your HtmlCanvasElement inside a BitmapData or RenderTexture. We have our own extensions to StageXL, and use this method a lot, but I'm not sure how many StageXL users are in our boat.

There is a workaround -- always do a context2D.getImageData() on at least one pixel, before every putImageData call (or a set of calls to the same canvas only). Turning off hardware acceleration also fixes the issue.

Feel free to close this issue after the jsfiddle no longer shows this bug on Chrome :) Good luck everyone.

audioMirror commented 7 years ago

This was indeed fixed in Chrome 62, which is being rolled out now (I got it last week).

bp74 commented 7 years ago

Sorry i totally missed this bug report when you posted it. Luckily Chrome fixed it already :)