summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-01-25 23:57:47 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-02-25 13:47:56 +0200
commite800f3754758489e09c55e38bebd00c2203e4886 (patch)
tree8eeb7642f569ddbe0b8e00e4a025f2c4e91b5706 /include/mbgl
parentfee22273be2d33049311de72ff6bf973b6b05164 (diff)
downloadqtlocation-mapboxgl-e800f3754758489e09c55e38bebd00c2203e4886.tar.gz
[core] Layer manager is responsible for buckets and layouts creation
This is a step to stop using of render layers in tile worker thread.
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/layermanager/circle_layer_factory.hpp1
-rw-r--r--include/mbgl/layermanager/fill_extrusion_layer_factory.hpp1
-rw-r--r--include/mbgl/layermanager/fill_layer_factory.hpp1
-rw-r--r--include/mbgl/layermanager/heatmap_layer_factory.hpp1
-rw-r--r--include/mbgl/layermanager/layer_factory.hpp15
-rw-r--r--include/mbgl/layermanager/layer_manager.hpp16
-rw-r--r--include/mbgl/layermanager/line_layer_factory.hpp3
-rw-r--r--include/mbgl/layermanager/symbol_layer_factory.hpp3
8 files changed, 36 insertions, 5 deletions
diff --git a/include/mbgl/layermanager/circle_layer_factory.hpp b/include/mbgl/layermanager/circle_layer_factory.hpp
index b632d892f4..e9eb0f59cc 100644
--- a/include/mbgl/layermanager/circle_layer_factory.hpp
+++ b/include/mbgl/layermanager/circle_layer_factory.hpp
@@ -8,6 +8,7 @@ class CircleLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
+ std::unique_ptr<Bucket> createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};
diff --git a/include/mbgl/layermanager/fill_extrusion_layer_factory.hpp b/include/mbgl/layermanager/fill_extrusion_layer_factory.hpp
index c524f61950..3430d3da1c 100644
--- a/include/mbgl/layermanager/fill_extrusion_layer_factory.hpp
+++ b/include/mbgl/layermanager/fill_extrusion_layer_factory.hpp
@@ -8,6 +8,7 @@ class FillExtrusionLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
+ std::unique_ptr<Layout> createLayout(const LayoutParameters&, std::unique_ptr<GeometryTileLayer>, const std::vector<const RenderLayer*>&) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};
diff --git a/include/mbgl/layermanager/fill_layer_factory.hpp b/include/mbgl/layermanager/fill_layer_factory.hpp
index eec7d0e7a0..22762d1290 100644
--- a/include/mbgl/layermanager/fill_layer_factory.hpp
+++ b/include/mbgl/layermanager/fill_layer_factory.hpp
@@ -8,6 +8,7 @@ class FillLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
+ std::unique_ptr<Layout> createLayout(const LayoutParameters&, std::unique_ptr<GeometryTileLayer>, const std::vector<const RenderLayer*>&) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};
diff --git a/include/mbgl/layermanager/heatmap_layer_factory.hpp b/include/mbgl/layermanager/heatmap_layer_factory.hpp
index b375dc9eb0..306af60938 100644
--- a/include/mbgl/layermanager/heatmap_layer_factory.hpp
+++ b/include/mbgl/layermanager/heatmap_layer_factory.hpp
@@ -8,6 +8,7 @@ class HeatmapLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
+ std::unique_ptr<Bucket> createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};
diff --git a/include/mbgl/layermanager/layer_factory.hpp b/include/mbgl/layermanager/layer_factory.hpp
index 3e2b2c3ddd..037de1b647 100644
--- a/include/mbgl/layermanager/layer_factory.hpp
+++ b/include/mbgl/layermanager/layer_factory.hpp
@@ -2,8 +2,15 @@
#include <mbgl/style/layer.hpp>
+#include <vector>
+
namespace mbgl {
+class Bucket;
+class BucketParameters;
+class GeometryTileLayer;
+class Layout;
+class LayoutParameters;
class RenderLayer;
/**
@@ -16,10 +23,14 @@ public:
virtual ~LayerFactory() = default;
/// Returns the layer type data.
virtual const style::LayerTypeInfo* getTypeInfo() const noexcept = 0;
- /// Returns a new Layer instance on success call; returns `nulltptr` otherwise.
+ /// Returns a new Layer instance on success call; returns `nullptr` otherwise.
virtual std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept = 0;
- /// Returns a new RenderLayer instance on success call; returns `nulltptr` otherwise.
+ /// Returns a new RenderLayer instance.
virtual std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept = 0;
+ /// Returns a new Bucket instance on success call; returns `nullptr` otherwise.
+ virtual std::unique_ptr<Bucket> createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) noexcept;
+ /// Returns a new Layout instance on success call; returns `nullptr` otherwise.
+ virtual std::unique_ptr<Layout> createLayout(const LayoutParameters&, std::unique_ptr<GeometryTileLayer>, const std::vector<const RenderLayer*>&) noexcept;
protected:
optional<std::string> getSource(const style::conversion::Convertible& value) const noexcept;
diff --git a/include/mbgl/layermanager/layer_manager.hpp b/include/mbgl/layermanager/layer_manager.hpp
index 038a6dcb04..de10b0207c 100644
--- a/include/mbgl/layermanager/layer_manager.hpp
+++ b/include/mbgl/layermanager/layer_manager.hpp
@@ -2,10 +2,16 @@
#include <mbgl/style/layer.hpp>
-namespace mbgl {
+#include <vector>
+namespace mbgl {
+class GeometryTileLayer;
class LayerFactory;
class RenderLayer;
+class Bucket;
+class BucketParameters;
+class Layout;
+class LayoutParameters;
/**
* @brief A singleton class responsible for creating layer instances.
@@ -25,11 +31,15 @@ public:
*/
static LayerManager* get() noexcept;
- /// Returns a new Layer instance on success call; returns `nulltptr` otherwise.
+ /// Returns a new Layer instance on success call; returns `nullptr` otherwise.
std::unique_ptr<style::Layer> createLayer(const std::string& type, const std::string& id,
const style::conversion::Convertible& value, style::conversion::Error& error) noexcept;
- /// Returns a new RenderLayer instance on success call; returns `nulltptr` otherwise.
+ /// Returns a new RenderLayer instance on success call; returns `nullptr` otherwise.
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept;
+ /// Returns a new Bucket instance on success call; returns `nullptr` otherwise.
+ std::unique_ptr<Bucket> createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) noexcept;
+ /// Returns a new Layout instance on success call; returns `nullptr` otherwise.
+ std::unique_ptr<Layout> createLayout(const LayoutParameters&, std::unique_ptr<GeometryTileLayer>, const std::vector<const RenderLayer*>&) noexcept;
/**
* @brief a build-time flag to enable/disable annotations in mapbox-gl-native core.
diff --git a/include/mbgl/layermanager/line_layer_factory.hpp b/include/mbgl/layermanager/line_layer_factory.hpp
index 8aa7e5105b..a7081228ee 100644
--- a/include/mbgl/layermanager/line_layer_factory.hpp
+++ b/include/mbgl/layermanager/line_layer_factory.hpp
@@ -8,6 +8,9 @@ class LineLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
+ std::unique_ptr<Layout> createLayout(const LayoutParameters& parameters,
+ std::unique_ptr<GeometryTileLayer> tileLayer,
+ const std::vector<const RenderLayer*>& group) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};
diff --git a/include/mbgl/layermanager/symbol_layer_factory.hpp b/include/mbgl/layermanager/symbol_layer_factory.hpp
index c10b100af6..dac515c9dc 100644
--- a/include/mbgl/layermanager/symbol_layer_factory.hpp
+++ b/include/mbgl/layermanager/symbol_layer_factory.hpp
@@ -8,6 +8,9 @@ class SymbolLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
+ std::unique_ptr<Layout> createLayout(const LayoutParameters& parameters,
+ std::unique_ptr<GeometryTileLayer> tileLayer,
+ const std::vector<const RenderLayer*>& group) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};