summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/layers/render_symbol_layer.hpp
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-01-03 17:17:57 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-01-11 11:30:04 +0200
commit2bdab82dedf545b4272c534b067c68614d0355b7 (patch)
treeee437a1e8f26a25fe2e30d65db3d4e4e2985ae10 /src/mbgl/renderer/layers/render_symbol_layer.hpp
parent2da9d483ac8bce5bfa7523f9113e1bc4ef2cbfb5 (diff)
downloadqtlocation-mapboxgl-2bdab82dedf545b4272c534b067c68614d0355b7.tar.gz
[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.
Diffstat (limited to 'src/mbgl/renderer/layers/render_symbol_layer.hpp')
-rw-r--r--src/mbgl/renderer/layers/render_symbol_layer.hpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mbgl/renderer/layers/render_symbol_layer.hpp b/src/mbgl/renderer/layers/render_symbol_layer.hpp
index 832fb94001..6b43f91a22 100644
--- a/src/mbgl/renderer/layers/render_symbol_layer.hpp
+++ b/src/mbgl/renderer/layers/render_symbol_layer.hpp
@@ -68,11 +68,8 @@ public:
bool hasCrossfade() const override;
void render(PaintParameters&, RenderSource*) override;
- style::IconPaintProperties::PossiblyEvaluated iconPaintProperties() const;
- style::TextPaintProperties::PossiblyEvaluated textPaintProperties() const;
-
- style::SymbolPropertyValues iconPropertyValues(const style::SymbolLayoutProperties::PossiblyEvaluated&) const;
- style::SymbolPropertyValues textPropertyValues(const style::SymbolLayoutProperties::PossiblyEvaluated&) const;
+ static style::IconPaintProperties::PossiblyEvaluated iconPaintProperties(const style::SymbolPaintProperties::PossiblyEvaluated&);
+ static style::TextPaintProperties::PossiblyEvaluated textPaintProperties(const style::SymbolPaintProperties::PossiblyEvaluated&);
std::unique_ptr<Bucket> createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) const override;
std::unique_ptr<Layout> createLayout(const BucketParameters&,
@@ -97,8 +94,13 @@ public:
const style::SymbolLayer::Impl& impl() const;
protected:
+ static style::SymbolPropertyValues iconPropertyValues(const style::SymbolPaintProperties::PossiblyEvaluated&,
+ const style::SymbolLayoutProperties::PossiblyEvaluated&);
+ static style::SymbolPropertyValues textPropertyValues(const style::SymbolPaintProperties::PossiblyEvaluated&,
+ const style::SymbolLayoutProperties::PossiblyEvaluated&);
RenderTiles filterRenderTiles(RenderTiles) const final;
void sortRenderTiles(const TransformState&) final;
+ void updateBucketPaintProperties(Bucket*) const final;
};
inline const RenderSymbolLayer* toRenderSymbolLayer(const RenderLayer* layer) {