From 7a7192516ffa9b4ed5b94b60961a4dc74fcf6e64 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Sun, 7 Apr 2019 23:24:17 +0300 Subject: [core] Introduce `LayerRenderData`. Source::update() accepts layer properties. --- src/mbgl/renderer/buckets/fill_bucket.cpp | 4 ++-- src/mbgl/renderer/buckets/fill_bucket.hpp | 2 +- src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp | 6 +++--- src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp | 4 ++-- src/mbgl/renderer/buckets/line_bucket.cpp | 4 ++-- src/mbgl/renderer/buckets/line_bucket.hpp | 2 +- src/mbgl/renderer/buckets/symbol_bucket.cpp | 8 ++++++-- src/mbgl/renderer/buckets/symbol_bucket.hpp | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) (limited to 'src/mbgl/renderer/buckets') diff --git a/src/mbgl/renderer/buckets/fill_bucket.cpp b/src/mbgl/renderer/buckets/fill_bucket.cpp index 2dffc555e2..c69b60327d 100644 --- a/src/mbgl/renderer/buckets/fill_bucket.cpp +++ b/src/mbgl/renderer/buckets/fill_bucket.cpp @@ -28,7 +28,7 @@ using namespace style; struct GeometryTooLongException : std::exception {}; FillBucket::FillBucket(const FillBucket::PossiblyEvaluatedLayoutProperties, - std::map layerPaintProperties, + const std::map>& layerPaintProperties, const float zoom, const uint32_t) { @@ -37,7 +37,7 @@ FillBucket::FillBucket(const FillBucket::PossiblyEvaluatedLayoutProperties, std::piecewise_construct, std::forward_as_tuple(pair.first), std::forward_as_tuple( - pair.second, + getEvaluated(pair.second), zoom)); } } diff --git a/src/mbgl/renderer/buckets/fill_bucket.hpp b/src/mbgl/renderer/buckets/fill_bucket.hpp index 5844625d2a..217524c945 100644 --- a/src/mbgl/renderer/buckets/fill_bucket.hpp +++ b/src/mbgl/renderer/buckets/fill_bucket.hpp @@ -22,7 +22,7 @@ public: using PossiblyEvaluatedLayoutProperties = style::Properties<>::PossiblyEvaluated; FillBucket(const PossiblyEvaluatedLayoutProperties layout, - std::map layerPaintProperties, + const std::map>& layerPaintProperties, const float zoom, const uint32_t overscaling); diff --git a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp index 61fc6a1444..7fa7293f33 100644 --- a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp +++ b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp @@ -34,8 +34,8 @@ using namespace style; struct GeometryTooLongException : std::exception {}; -FillExtrusionBucket::FillExtrusionBucket(const FillExtrusionBucket::PossiblyEvaluatedLayoutProperties, - std::map layerPaintProperties, +FillExtrusionBucket::FillExtrusionBucket(const FillExtrusionBucket::PossiblyEvaluatedLayoutProperties&, + const std::map>& layerPaintProperties, const float zoom, const uint32_t) { for (const auto& pair : layerPaintProperties) { @@ -43,7 +43,7 @@ FillExtrusionBucket::FillExtrusionBucket(const FillExtrusionBucket::PossiblyEval std::piecewise_construct, std::forward_as_tuple(pair.first), std::forward_as_tuple( - pair.second, + getEvaluated(pair.second), zoom)); } } diff --git a/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp b/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp index 9dc2681bac..85867031a7 100644 --- a/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp +++ b/src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp @@ -19,8 +19,8 @@ public: using PossiblyEvaluatedPaintProperties = style::FillExtrusionPaintProperties::PossiblyEvaluated; using PossiblyEvaluatedLayoutProperties = style::Properties<>::PossiblyEvaluated; - FillExtrusionBucket(const PossiblyEvaluatedLayoutProperties, - std::map, + FillExtrusionBucket(const PossiblyEvaluatedLayoutProperties&, + const std::map>&, const float, const uint32_t); diff --git a/src/mbgl/renderer/buckets/line_bucket.cpp b/src/mbgl/renderer/buckets/line_bucket.cpp index 9a5ed9e628..c2cce632b3 100644 --- a/src/mbgl/renderer/buckets/line_bucket.cpp +++ b/src/mbgl/renderer/buckets/line_bucket.cpp @@ -11,7 +11,7 @@ namespace mbgl { using namespace style; LineBucket::LineBucket(const style::LineLayoutProperties::PossiblyEvaluated layout_, - const std::map& layerPaintProperties, + const std::map>& layerPaintProperties, const float zoom_, const uint32_t overscaling_) : layout(std::move(layout_)), @@ -23,7 +23,7 @@ LineBucket::LineBucket(const style::LineLayoutProperties::PossiblyEvaluated layo std::piecewise_construct, std::forward_as_tuple(pair.first), std::forward_as_tuple( - pair.second, + getEvaluated(pair.second), zoom)); } } diff --git a/src/mbgl/renderer/buckets/line_bucket.hpp b/src/mbgl/renderer/buckets/line_bucket.hpp index 6717ee7446..9afe7fecee 100644 --- a/src/mbgl/renderer/buckets/line_bucket.hpp +++ b/src/mbgl/renderer/buckets/line_bucket.hpp @@ -21,7 +21,7 @@ public: using PossiblyEvaluatedLayoutProperties = style::LineLayoutProperties::PossiblyEvaluated; LineBucket(const PossiblyEvaluatedLayoutProperties layout, - const std::map& layerPaintProperties, + const std::map>& layerPaintProperties, const float zoom, const uint32_t overscaling); ~LineBucket() override; diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp index a0ebab20be..4b5207da39 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.cpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp @@ -8,8 +8,12 @@ namespace mbgl { using namespace style; +const SymbolLayerProperties& toSymbolLayerProperties(const Immutable& layer) { + return static_cast(*layer); +} + SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layout_, - const std::map& paintProperties_, + const std::map>& paintProperties_, const style::PropertyValue& textSize, const style::PropertyValue& iconSize, float zoom, @@ -30,7 +34,7 @@ SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layo tilePixelRatio(tilePixelRatio_) { for (const auto& pair : paintProperties_) { - auto layerPaintProperties = pair.second; + auto layerPaintProperties = toSymbolLayerProperties(pair.second).evaluated; if (hasFormatSectionOverrides()) { setPaintPropertyOverrides(layerPaintProperties); } diff --git a/src/mbgl/renderer/buckets/symbol_bucket.hpp b/src/mbgl/renderer/buckets/symbol_bucket.hpp index f8ffc1a8eb..ca740c5488 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.hpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.hpp @@ -42,7 +42,7 @@ public: class SymbolBucket final : public Bucket { public: SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated, - const std::map&, + const std::map>&, const style::PropertyValue& textSize, const style::PropertyValue& iconSize, float zoom, -- cgit v1.2.1