[core] shader program must always match bucket in render symbol layer

Before this change, `RenderSymbolLayer` with updated style was trying to render
symbols using the previous bucket (with paint property binders that matched a previous program).

Now, symbol bucket caches the latest corresponding paint properties (caching is happening on
complete tiles only). As a result, `RenderSymbolLayer` always picks the shader program and
its parameters in sync with the obtained bucket.
This commit is contained in:
Mikhail Pozdnyakov
2019-01-03 17:17:57 +02:00
parent 2da9d483ac
commit 2bdab82ded
8 changed files with 73 additions and 53 deletions

View File

@@ -96,6 +96,10 @@ protected:
// Code specific to RenderTiles sorting / filtering
virtual RenderTiles filterRenderTiles(RenderTiles) const;
virtual void sortRenderTiles(const TransformState&);
// For some layers, we want Buckets to cache their corresponding paint properties, so that outdated buckets (and
// the cached paint properties) can be still in use while the tile is loading new buckets (which will
// correpond to the current paint properties of the layer).
virtual void updateBucketPaintProperties(Bucket*) const;
using FilterFunctionPtr = bool (*)(RenderTile&);
RenderTiles filterRenderTiles(RenderTiles, FilterFunctionPtr) const;