diff options
Diffstat (limited to 'src/mbgl/renderer/buckets')
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.cpp | 22 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.hpp | 13 |
2 files changed, 18 insertions, 17 deletions
diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp index 4947b6b521..969597f5bd 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.cpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp @@ -9,7 +9,7 @@ namespace mbgl { using namespace style; SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layout_, - std::map<std::string, style::SymbolPaintProperties::PossiblyEvaluated> paintProperties_, + const std::map<std::string, style::SymbolPaintProperties::PossiblyEvaluated>& paintProperties_, const style::PropertyValue<float>& textSize, const style::PropertyValue<float>& iconSize, float zoom, @@ -24,18 +24,18 @@ SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layo sortFeaturesByY(sortFeaturesByY_), bucketLeaderID(std::move(bucketName_)), symbolInstances(std::move(symbolInstances_)), - paintProperties(std::move(paintProperties_)), textSizeBinder(SymbolSizeBinder::create(zoom, textSize, TextSize::defaultValue())), iconSizeBinder(SymbolSizeBinder::create(zoom, iconSize, IconSize::defaultValue())) { - for (const auto& pair : paintProperties) { - paintPropertyBinders.emplace( + for (const auto& pair : paintProperties_) { + paintProperties.emplace( std::piecewise_construct, std::forward_as_tuple(pair.first), - std::forward_as_tuple( - std::piecewise_construct, - std::forward_as_tuple(RenderSymbolLayer::iconPaintProperties(pair.second), zoom), - std::forward_as_tuple(RenderSymbolLayer::textPaintProperties(pair.second), zoom))); + std::forward_as_tuple(PaintProperties { + pair.second, + { RenderSymbolLayer::iconPaintProperties(pair.second), zoom }, + { RenderSymbolLayer::textPaintProperties(pair.second), zoom } + })); } } @@ -110,9 +110,9 @@ void SymbolBucket::upload(gl::Context& context) { } if (!staticUploaded) { - for (auto& pair : paintPropertyBinders) { - pair.second.first.upload(context); - pair.second.second.upload(context); + for (auto& pair : paintProperties) { + pair.second.iconBinders.upload(context); + pair.second.textBinders.upload(context); } } diff --git a/src/mbgl/renderer/buckets/symbol_bucket.hpp b/src/mbgl/renderer/buckets/symbol_bucket.hpp index 76fab2fa0f..0388c5756b 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.hpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.hpp @@ -40,7 +40,7 @@ public: class SymbolBucket final : public Bucket { public: SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated, - std::map<std::string, style::SymbolPaintProperties::PossiblyEvaluated>, + const std::map<std::string, style::SymbolPaintProperties::PossiblyEvaluated>&, const style::PropertyValue<float>& textSize, const style::PropertyValue<float>& iconSize, float zoom, @@ -78,11 +78,12 @@ public: std::vector<SymbolInstance> symbolInstances; - std::map<std::string, style::SymbolPaintProperties::PossiblyEvaluated> paintProperties; - - std::map<std::string, std::pair< - SymbolIconProgram::PaintPropertyBinders, - SymbolSDFTextProgram::PaintPropertyBinders>> paintPropertyBinders; + struct PaintProperties { + style::SymbolPaintProperties::PossiblyEvaluated evaluated; + SymbolIconProgram::PaintPropertyBinders iconBinders; + SymbolSDFTextProgram::PaintPropertyBinders textBinders; + }; + std::map<std::string, PaintProperties> paintProperties; std::unique_ptr<SymbolSizeBinder> textSizeBinder; |