StrandedKitty / streets-gl

🗺 OpenStreetMap 3D renderer powered by WebGL2
http://streets.gl
MIT License
598 stars 43 forks source link

Minor improvements #183

Closed gpSWE closed 3 weeks ago

gpSWE commented 2 months ago

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

HolgerJeromin commented 2 months ago

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

gpSWE commented 2 months ago

@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

StrandedKitty commented 3 weeks ago

Thank you!