summaryrefslogtreecommitdiff
path: root/src/mbgl/layermanager
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/layermanager')
-rw-r--r--src/mbgl/layermanager/circle_layer_factory.cpp5
-rw-r--r--src/mbgl/layermanager/fill_extrusion_layer_factory.cpp7
-rw-r--r--src/mbgl/layermanager/fill_layer_factory.cpp8
-rw-r--r--src/mbgl/layermanager/heatmap_layer_factory.cpp5
-rw-r--r--src/mbgl/layermanager/layer_factory.cpp14
-rw-r--r--src/mbgl/layermanager/layer_manager.cpp21
-rw-r--r--src/mbgl/layermanager/line_layer_factory.cpp7
-rw-r--r--src/mbgl/layermanager/symbol_layer_factory.cpp11
8 files changed, 78 insertions, 0 deletions
diff --git a/src/mbgl/layermanager/circle_layer_factory.cpp b/src/mbgl/layermanager/circle_layer_factory.cpp
index 215f228aa2..0ea56e5711 100644
--- a/src/mbgl/layermanager/circle_layer_factory.cpp
+++ b/src/mbgl/layermanager/circle_layer_factory.cpp
@@ -1,5 +1,6 @@
#include <mbgl/layermanager/circle_layer_factory.hpp>
+#include <mbgl/renderer/buckets/circle_bucket.hpp>
#include <mbgl/renderer/layers/render_circle_layer.hpp>
#include <mbgl/style/layers/circle_layer.hpp>
#include <mbgl/style/layers/circle_layer_impl.hpp>
@@ -23,6 +24,10 @@ std::unique_ptr<style::Layer> CircleLayerFactory::createLayer(const std::string&
return layer;
}
+std::unique_ptr<Bucket> CircleLayerFactory::createBucket(const BucketParameters& parameters, const std::vector<const RenderLayer*>& layers) noexcept {
+ return std::make_unique<CircleBucket>(parameters, layers);
+}
+
std::unique_ptr<RenderLayer> CircleLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
assert(impl->getTypeInfo() == getTypeInfo());
return std::make_unique<RenderCircleLayer>(staticImmutableCast<style::CircleLayer::Impl>(std::move(impl)));
diff --git a/src/mbgl/layermanager/fill_extrusion_layer_factory.cpp b/src/mbgl/layermanager/fill_extrusion_layer_factory.cpp
index 8b90d950d0..b2558825ef 100644
--- a/src/mbgl/layermanager/fill_extrusion_layer_factory.cpp
+++ b/src/mbgl/layermanager/fill_extrusion_layer_factory.cpp
@@ -1,5 +1,6 @@
#include <mbgl/layermanager/fill_extrusion_layer_factory.hpp>
+#include <mbgl/renderer/buckets/fill_extrusion_bucket.hpp>
#include <mbgl/renderer/layers/render_fill_extrusion_layer.hpp>
#include <mbgl/style/layers/fill_extrusion_layer.hpp>
#include <mbgl/style/layers/fill_extrusion_layer_impl.hpp>
@@ -23,6 +24,12 @@ std::unique_ptr<style::Layer> FillExtrusionLayerFactory::createLayer(const std::
return layer;
}
+std::unique_ptr<Layout> FillExtrusionLayerFactory::createLayout(const LayoutParameters& parameters,
+ std::unique_ptr<GeometryTileLayer> layer,
+ const std::vector<const RenderLayer*>& group) noexcept {
+ return std::make_unique<PatternLayout<FillExtrusionBucket>>(parameters.bucketParameters, group, std::move(layer), parameters.imageDependencies);
+}
+
std::unique_ptr<RenderLayer> FillExtrusionLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
assert(impl->getTypeInfo() == getTypeInfo());
return std::make_unique<RenderFillExtrusionLayer>(staticImmutableCast<style::FillExtrusionLayer::Impl>(std::move(impl)));
diff --git a/src/mbgl/layermanager/fill_layer_factory.cpp b/src/mbgl/layermanager/fill_layer_factory.cpp
index 664788de17..60a1818585 100644
--- a/src/mbgl/layermanager/fill_layer_factory.cpp
+++ b/src/mbgl/layermanager/fill_layer_factory.cpp
@@ -1,5 +1,6 @@
#include <mbgl/layermanager/fill_layer_factory.hpp>
+#include <mbgl/renderer/buckets/fill_bucket.hpp>
#include <mbgl/renderer/layers/render_fill_layer.hpp>
#include <mbgl/style/layers/fill_layer.hpp>
#include <mbgl/style/layers/fill_layer_impl.hpp>
@@ -23,6 +24,13 @@ std::unique_ptr<style::Layer> FillLayerFactory::createLayer(const std::string& i
return layer;
}
+std::unique_ptr<Layout>
+FillLayerFactory::createLayout(const LayoutParameters& parameters,
+ std::unique_ptr<GeometryTileLayer> layer,
+ const std::vector<const RenderLayer*>& group) noexcept {
+ return std::make_unique<PatternLayout<FillBucket>>(parameters.bucketParameters, group, std::move(layer), parameters.imageDependencies);
+}
+
std::unique_ptr<RenderLayer> FillLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
assert(impl->getTypeInfo() == getTypeInfo());
return std::make_unique<RenderFillLayer>(staticImmutableCast<style::FillLayer::Impl>(std::move(impl)));
diff --git a/src/mbgl/layermanager/heatmap_layer_factory.cpp b/src/mbgl/layermanager/heatmap_layer_factory.cpp
index 4785b7c010..5d6a595b46 100644
--- a/src/mbgl/layermanager/heatmap_layer_factory.cpp
+++ b/src/mbgl/layermanager/heatmap_layer_factory.cpp
@@ -1,5 +1,6 @@
#include <mbgl/layermanager/heatmap_layer_factory.hpp>
+#include <mbgl/renderer/buckets/heatmap_bucket.hpp>
#include <mbgl/renderer/layers/render_heatmap_layer.hpp>
#include <mbgl/style/layers/heatmap_layer.hpp>
#include <mbgl/style/layers/heatmap_layer_impl.hpp>
@@ -23,6 +24,10 @@ std::unique_ptr<style::Layer> HeatmapLayerFactory::createLayer(const std::string
return layer;
}
+std::unique_ptr<Bucket> HeatmapLayerFactory::createBucket(const BucketParameters& parameters, const std::vector<const RenderLayer*>& layers) noexcept {
+ return std::make_unique<HeatmapBucket>(parameters, layers);
+}
+
std::unique_ptr<RenderLayer> HeatmapLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
assert(impl->getTypeInfo() == getTypeInfo());
return std::make_unique<RenderHeatmapLayer>(staticImmutableCast<style::HeatmapLayer::Impl>(std::move(impl)));
diff --git a/src/mbgl/layermanager/layer_factory.cpp b/src/mbgl/layermanager/layer_factory.cpp
index c7f63b8699..ceeb304f44 100644
--- a/src/mbgl/layermanager/layer_factory.cpp
+++ b/src/mbgl/layermanager/layer_factory.cpp
@@ -1,5 +1,9 @@
#include <mbgl/layermanager/layer_factory.hpp>
+#include <mbgl/layout/layout.hpp>
+#include <mbgl/renderer/bucket.hpp>
+#include <mbgl/renderer/bucket_parameters.hpp>
+
#include <mbgl/style/conversion/constant.hpp>
#include <mbgl/style/conversion/filter.hpp>
#include <mbgl/style/conversion_impl.hpp>
@@ -21,6 +25,16 @@ optional<std::string> LayerFactory::getSource(const style::conversion::Convertib
return source;
}
+std::unique_ptr<Bucket> LayerFactory::createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) noexcept {
+ assert(false);
+ return nullptr;
+}
+
+std::unique_ptr<Layout> LayerFactory::createLayout(const LayoutParameters&, std::unique_ptr<GeometryTileLayer>, const std::vector<const RenderLayer*>&) noexcept {
+ assert(false);
+ return nullptr;
+}
+
bool LayerFactory::initSourceLayerAndFilter(style::Layer* layer, const style::conversion::Convertible& value) const noexcept {
auto sourceLayerValue = objectMember(value, "source-layer");
if (sourceLayerValue) {
diff --git a/src/mbgl/layermanager/layer_manager.cpp b/src/mbgl/layermanager/layer_manager.cpp
index 8f42bc9218..e6195caeba 100644
--- a/src/mbgl/layermanager/layer_manager.cpp
+++ b/src/mbgl/layermanager/layer_manager.cpp
@@ -1,6 +1,9 @@
#include <mbgl/layermanager/layer_manager.hpp>
+#include <mbgl/layout/layout.hpp>
#include <mbgl/layermanager/layer_factory.hpp>
+#include <mbgl/renderer/bucket.hpp>
+#include <mbgl/renderer/bucket_parameters.hpp>
#include <mbgl/renderer/render_layer.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/layer_impl.hpp>
@@ -22,6 +25,24 @@ std::unique_ptr<style::Layer> LayerManager::createLayer(
return nullptr;
}
+std::unique_ptr<Bucket> LayerManager::createBucket(const BucketParameters& parameters, const std::vector<const RenderLayer*>& layers) noexcept {
+ assert(!layers.empty());
+ assert(parameters.layerType->layout == style::LayerTypeInfo::Layout::NotRequired);
+ LayerFactory* factory = getFactory(parameters.layerType);
+ assert(factory);
+ return factory->createBucket(parameters, layers);
+}
+
+std::unique_ptr<Layout> LayerManager::createLayout(const LayoutParameters& parameters,
+ std::unique_ptr<GeometryTileLayer> tileLayer,
+ const std::vector<const RenderLayer*>& layers) noexcept {
+ assert(!layers.empty());
+ assert(parameters.bucketParameters.layerType->layout == style::LayerTypeInfo::Layout::Required);
+ LayerFactory* factory = getFactory(parameters.bucketParameters.layerType);
+ assert(factory);
+ return factory->createLayout(parameters, std::move(tileLayer), layers);
+}
+
std::unique_ptr<RenderLayer> LayerManager::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
LayerFactory* factory = getFactory(impl->getTypeInfo());
assert(factory);
diff --git a/src/mbgl/layermanager/line_layer_factory.cpp b/src/mbgl/layermanager/line_layer_factory.cpp
index 7a8ea01d79..8bf756e159 100644
--- a/src/mbgl/layermanager/line_layer_factory.cpp
+++ b/src/mbgl/layermanager/line_layer_factory.cpp
@@ -1,5 +1,6 @@
#include <mbgl/layermanager/line_layer_factory.hpp>
+#include <mbgl/renderer/buckets/line_bucket.hpp>
#include <mbgl/renderer/layers/render_line_layer.hpp>
#include <mbgl/style/layers/line_layer.hpp>
#include <mbgl/style/layers/line_layer_impl.hpp>
@@ -23,6 +24,12 @@ std::unique_ptr<style::Layer> LineLayerFactory::createLayer(const std::string& i
return layer;
}
+std::unique_ptr<Layout> LineLayerFactory::createLayout(const LayoutParameters& parameters,
+ std::unique_ptr<GeometryTileLayer> layer,
+ const std::vector<const RenderLayer*>& group) noexcept {
+ return std::make_unique<PatternLayout<LineBucket>>(parameters.bucketParameters, group, std::move(layer), parameters.imageDependencies);
+}
+
std::unique_ptr<RenderLayer> LineLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
assert(impl->getTypeInfo() == getTypeInfo());
return std::make_unique<RenderLineLayer>(staticImmutableCast<style::LineLayer::Impl>(std::move(impl)));
diff --git a/src/mbgl/layermanager/symbol_layer_factory.cpp b/src/mbgl/layermanager/symbol_layer_factory.cpp
index 8acefb9f41..d992741551 100644
--- a/src/mbgl/layermanager/symbol_layer_factory.cpp
+++ b/src/mbgl/layermanager/symbol_layer_factory.cpp
@@ -1,5 +1,6 @@
#include <mbgl/layermanager/symbol_layer_factory.hpp>
+#include <mbgl/layout/symbol_layout.hpp>
#include <mbgl/renderer/layers/render_symbol_layer.hpp>
#include <mbgl/style/layers/symbol_layer.hpp>
#include <mbgl/style/layers/symbol_layer_impl.hpp>
@@ -23,6 +24,16 @@ std::unique_ptr<style::Layer> SymbolLayerFactory::createLayer(const std::string&
return layer;
}
+std::unique_ptr<Layout> SymbolLayerFactory::createLayout(const LayoutParameters& parameters,
+ std::unique_ptr<GeometryTileLayer> tileLayer,
+ const std::vector<const RenderLayer*>& group) noexcept {
+ return std::make_unique<SymbolLayout>(parameters.bucketParameters,
+ group,
+ std::move(tileLayer),
+ parameters.imageDependencies,
+ parameters.glyphDependencies);
+}
+
std::unique_ptr<RenderLayer> SymbolLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
assert(impl->getTypeInfo() == getTypeInfo());
return std::make_unique<RenderSymbolLayer>(staticImmutableCast<style::SymbolLayer::Impl>(std::move(impl)));