diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-07-31 14:21:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 14:21:47 -0700 |
commit | 9bdd765a02de75851a00ab85223d5d582a104757 (patch) | |
tree | bcb417a47808a4a94c171b083c7f2e2cce457107 /src/mbgl/renderer | |
parent | 885f6e3c02138398d094e49243817a83349b4d50 (diff) | |
download | qtlocation-mapboxgl-9bdd765a02de75851a00ab85223d5d582a104757.tar.gz |
[core] Merge DataDrivenPropertyValue into PropertyValue (#12513)
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.cpp | 20 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.hpp | 20 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp index 0a1530ae74..027e864be5 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.cpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp @@ -12,8 +12,8 @@ SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layo const std::map<std::string, std::pair< style::IconPaintProperties::PossiblyEvaluated, style::TextPaintProperties::PossiblyEvaluated>>& layerPaintProperties, - const style::DataDrivenPropertyValue<float>& textSize, - const style::DataDrivenPropertyValue<float>& iconSize, + const style::PropertyValue<float>& textSize, + const style::PropertyValue<float>& iconSize, float zoom, bool sdfIcons_, bool iconsNeedLinear_, @@ -29,7 +29,7 @@ SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layo symbolInstances(std::move(symbolInstances_)), textSizeBinder(SymbolSizeBinder::create(zoom, textSize, TextSize::defaultValue())), iconSizeBinder(SymbolSizeBinder::create(zoom, iconSize, IconSize::defaultValue())) { - + for (const auto& pair : layerPaintProperties) { paintPropertyBinders.emplace( std::piecewise_construct, @@ -49,7 +49,7 @@ void SymbolBucket::upload(gl::Context& context) { } else if (!sortUploaded) { context.updateIndexBuffer(*text.indexBuffer, std::move(text.triangles)); } - + if (!dynamicUploaded) { text.dynamicVertexBuffer = context.createVertexBuffer(std::move(text.dynamicVertices), gl::BufferUsage::StreamDraw); } @@ -94,7 +94,7 @@ void SymbolBucket::upload(gl::Context& context) { } } } - + if (hasCollisionCircleData()) { if (!staticUploaded) { collisionCircle.indexBuffer = context.createIndexBuffer(std::move(collisionCircle.triangles)); @@ -115,7 +115,7 @@ void SymbolBucket::upload(gl::Context& context) { pair.second.second.upload(context); } } - + uploaded = true; staticUploaded = true; placementChangesUploaded = true; @@ -164,7 +164,7 @@ void SymbolBucket::sortFeatures(const float angle) { if (sortedAngle && *sortedAngle == angle) { return; } - + sortedAngle = angle; // The current approach to sorting doesn't sort across segments so don't try. @@ -172,7 +172,7 @@ void SymbolBucket::sortFeatures(const float angle) { if (text.segments.size() > 1 || icon.segments.size() > 1) { return; } - + sortUploaded = false; uploaded = false; @@ -186,7 +186,7 @@ void SymbolBucket::sortFeatures(const float angle) { for (size_t i = 0; i < symbolInstances.size(); i++) { symbolInstanceIndexes.push_back(i); } - + const float sin = std::sin(angle); const float cos = std::cos(angle); @@ -205,7 +205,7 @@ void SymbolBucket::sortFeatures(const float angle) { featureSortOrder = std::make_unique<std::vector<size_t>>(); featureSortOrder->reserve(symbolInstanceIndexes.size()); - + for (auto i : symbolInstanceIndexes) { const SymbolInstance& symbolInstance = symbolInstances[i]; featureSortOrder->push_back(symbolInstance.dataFeatureIndex); diff --git a/src/mbgl/renderer/buckets/symbol_bucket.hpp b/src/mbgl/renderer/buckets/symbol_bucket.hpp index 4f01cf4e1c..5addff40b2 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.hpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.hpp @@ -41,8 +41,8 @@ class SymbolBucket : public Bucket { public: SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated, const std::map<std::string, std::pair<style::IconPaintProperties::PossiblyEvaluated, style::TextPaintProperties::PossiblyEvaluated>>&, - const style::DataDrivenPropertyValue<float>& textSize, - const style::DataDrivenPropertyValue<float>& iconSize, + const style::PropertyValue<float>& textSize, + const style::PropertyValue<float>& iconSize, float zoom, bool sdfIcons, bool iconsNeedLinear, @@ -56,7 +56,7 @@ public: bool hasIconData() const; bool hasCollisionBoxData() const; bool hasCollisionCircleData() const; - + void updateOpacity(); void sortFeatures(const float angle); @@ -64,9 +64,9 @@ public: const bool sdfIcons; const bool iconsNeedLinear; const bool sortFeaturesByY; - + const std::string bucketLeaderID; - + optional<float> sortedAngle; bool staticUploaded = false; @@ -79,7 +79,7 @@ public: std::map<std::string, std::pair< SymbolIconProgram::PaintPropertyBinders, SymbolSDFTextProgram::PaintPropertyBinders>> paintPropertyBinders; - + std::unique_ptr<SymbolSizeBinder> textSizeBinder; struct TextBuffer { @@ -95,9 +95,9 @@ public: optional<gl::VertexBuffer<SymbolOpacityAttributes::Vertex>> opacityVertexBuffer; optional<gl::IndexBuffer<gl::Triangles>> indexBuffer; } text; - + std::unique_ptr<SymbolSizeBinder> iconSizeBinder; - + struct IconBuffer { gl::VertexVector<SymbolLayoutVertex> vertices; gl::VertexVector<SymbolDynamicLayoutAttributes::Vertex> dynamicVertices; @@ -126,7 +126,7 @@ public: gl::IndexVector<gl::Lines> lines; optional<gl::IndexBuffer<gl::Lines>> indexBuffer; } collisionBox; - + struct CollisionCircleBuffer : public CollisionBuffer { gl::IndexVector<gl::Triangles> triangles; optional<gl::IndexBuffer<gl::Triangles>> indexBuffer; @@ -134,7 +134,7 @@ public: uint32_t bucketInstanceId = 0; bool justReloaded = false; - + std::shared_ptr<std::vector<size_t>> featureSortOrder; }; |