summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/buckets
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-04-07 23:24:17 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-04-17 17:21:41 +0300
commit7a7192516ffa9b4ed5b94b60961a4dc74fcf6e64 (patch)
tree432a69b7a31b833304ccafcffe83b0cfe00d3c1f /src/mbgl/renderer/buckets
parent4b21560cf59877125ea0bdae1a2546ab06f1efb2 (diff)
downloadqtlocation-mapboxgl-7a7192516ffa9b4ed5b94b60961a4dc74fcf6e64.tar.gz
[core] Introduce `LayerRenderData`. Source::update() accepts layer properties.
Diffstat (limited to 'src/mbgl/renderer/buckets')
-rw-r--r--src/mbgl/renderer/buckets/fill_bucket.cpp4
-rw-r--r--src/mbgl/renderer/buckets/fill_bucket.hpp2
-rw-r--r--src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp6
-rw-r--r--src/mbgl/renderer/buckets/fill_extrusion_bucket.hpp4
-rw-r--r--src/mbgl/renderer/buckets/line_bucket.cpp4
-rw-r--r--src/mbgl/renderer/buckets/line_bucket.hpp2
-rw-r--r--src/mbgl/renderer/buckets/symbol_bucket.cpp8
-rw-r--r--src/mbgl/renderer/buckets/symbol_bucket.hpp2
8 files changed, 18 insertions, 14 deletions
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<std::string, FillBucket::PossiblyEvaluatedPaintProperties> layerPaintProperties,
+ const std::map<std::string, Immutable<style::LayerProperties>>& 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<FillLayerProperties>(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<std::string, PossiblyEvaluatedPaintProperties> layerPaintProperties,
+ const std::map<std::string, Immutable<style::LayerProperties>>& 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<std::string, FillExtrusionBucket::PossiblyEvaluatedPaintProperties> layerPaintProperties,
+FillExtrusionBucket::FillExtrusionBucket(const FillExtrusionBucket::PossiblyEvaluatedLayoutProperties&,
+ const std::map<std::string, Immutable<style::LayerProperties>>& 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<FillExtrusionLayerProperties>(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<std::string, PossiblyEvaluatedPaintProperties>,
+ FillExtrusionBucket(const PossiblyEvaluatedLayoutProperties&,
+ const std::map<std::string, Immutable<style::LayerProperties>>&,
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<std::string, style::LinePaintProperties::PossiblyEvaluated>& layerPaintProperties,
+ const std::map<std::string, Immutable<style::LayerProperties>>& 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<LineLayerProperties>(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<std::string, PossiblyEvaluatedPaintProperties>& layerPaintProperties,
+ const std::map<std::string, Immutable<style::LayerProperties>>& 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<LayerProperties>& layer) {
+ return static_cast<const SymbolLayerProperties&>(*layer);
+}
+
SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated layout_,
- const std::map<std::string, style::SymbolPaintProperties::PossiblyEvaluated>& paintProperties_,
+ const std::map<std::string, Immutable<style::LayerProperties>>& paintProperties_,
const style::PropertyValue<float>& textSize,
const style::PropertyValue<float>& 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<std::string, style::SymbolPaintProperties::PossiblyEvaluated>&,
+ const std::map<std::string, Immutable<style::LayerProperties>>&,
const style::PropertyValue<float>& textSize,
const style::PropertyValue<float>& iconSize,
float zoom,