You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing an HTML5 game with HaxeFlixel and get numerous warnings in Chrome's developer console:
ImageCanvasUtil.hx:212 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
This 'willReadFrequently' attribute is not set by ImageCanvasUtil.hx and I do not see any way to set this attribute with the current API.
The text was updated successfully, but these errors were encountered:
Pretty sure that would be a net performance loss. Faster reading at the expense of slower rendering.
That is a reasonable prediction and I don't know enough about Canvas2D to debate it. I am simply relaying the warning as communicated by Chrome's developer console, some of the HaxeFlixel demos report many, many Canvas2D warnings with this message.
The FlxPieDial Demo reports 33 warnings for example. Most demos report zero. TurnBasedRPG reports one if you play it through to the end.
Are these warnings mainly during setup? Looks like FlxPieDial makes multiple calls to copyPixels(), but I'm pretty sure that's only during setup.
If copyPixels() and similar operations are in fact the culprit, we may want to add an argument to the BitmapData constructor. Let you set it per bitmap. Maybe call the argument willReadFrequently like in JS, or maybe useSoftwareRenderer to be explicit about the effects.
JS was the only one to print a warning, but the hardware/software tradeoff should be comparable on all targets. If we decide to add this, we should make it cross-platform.
I am developing an HTML5 game with HaxeFlixel and get numerous warnings in Chrome's developer console:
This 'willReadFrequently' attribute is not set by ImageCanvasUtil.hx and I do not see any way to set this attribute with the current API.
The text was updated successfully, but these errors were encountered: