From 2bdab82dedf545b4272c534b067c68614d0355b7 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Thu, 3 Jan 2019 17:17:57 +0200 Subject: [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. --- src/mbgl/renderer/layers/render_symbol_layer.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/mbgl/renderer/layers/render_symbol_layer.hpp') 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 createBucket(const BucketParameters&, const std::vector&) const override; std::unique_ptr 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) { -- cgit v1.2.1