streets-gl icon indicating copy to clipboard operation
streets-gl copied to clipboard

Minor improvements

Open najimovs opened this issue 1 year ago • 2 comments

This will force the use of a software (instead of hardware accelerated) 2D canvas and can save memory when calling getImageData() frequently.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#willreadfrequently

najimovs avatar Apr 21 '24 07:04 najimovs

Why is this an improvement? Disabling hardware support seems like a bad idea ~~and I do not see use of getImageData() in this repo~~.

HolgerJeromin avatar Apr 21 '24 20:04 HolgerJeromin

@HolgerJeromin I agree that software instead of hardware is not a good idea. Especially for rendering.

The getImageData() function is quickly used for terrain purposes for a tile. You may also see Chrome display performance warnings.

https://stackoverflow.com/questions/74101155/chrome-warning-willreadfrequently-attribute-set-to-true

najimovs avatar Apr 22 '24 05:04 najimovs

Thank you!

StrandedKitty avatar Jun 12 '24 05:06 StrandedKitty