Layer: avoid LayerComposer when possible
Currently, the images coming from the ImageSource are always put into the LayerComposer, which in turns composes those image into a texture for each Map tile.
However, the LayerComposer can be avoided if the following conditions are met:
- the CRS of the
ImageSourceis the same as the CRS of theInstance(i.e no reprojection) - the
ImageSourcecan produce exactly one image per map tile (that excludes tiled layers such as WMTS) - the images produced by the
ImageSourcedo not need interpretation decoding (currently done in theLayerComposer, although that could be moved elsewhere, especially with the introduction of web workers, see !591 (closed)).
In that case, the textures produced by the ImageSource can be directly applied to the TileMesh, without any intermediate step.
The benefits are massive:
- no GPU time wasted in composing images
- no allocation of
RenderTargets for map tiles - shorter latency before the image is visible. Especially useful for sources that can change frequently, such as
VectorSources with dynamic styles.