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
ImageSource
is the same as the CRS of theInstance
(i.e no reprojection) - the
ImageSource
can produce exactly one image per map tile (that excludes tiled layers such as WMTS) - the images produced by the
ImageSource
do 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
RenderTarget
s for map tiles - shorter latency before the image is visible. Especially useful for sources that can change frequently, such as
VectorSource
s with dynamic styles.