diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-11-22 15:37:09 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-11-27 18:10:21 +0200 |
commit | 361982fef83a145769da5c04d1c19731df89921c (patch) | |
tree | e6212cb782cf9df83ecc3e32cb52beaebeb73ab8 /include/mbgl/style/layers | |
parent | cca37e765bf9b853262783a6f7cc3d1a4c72957d (diff) | |
download | qtlocation-mapboxgl-361982fef83a145769da5c04d1c19731df89921c.tar.gz |
[core][Android][Darwin] LayerManager creates RenderLayer instances
`LayerManager` is now responsible for `RenderLayer` instances creation,
so that there is a single entry point for creating of objects, which
correspond to a certain layer type.
The `LayerType type` field is dropped from `Layer::Impl`.
Diffstat (limited to 'include/mbgl/style/layers')
-rw-r--r-- | include/mbgl/style/layers/background_layer.hpp | 14 | ||||
-rw-r--r-- | include/mbgl/style/layers/circle_layer.hpp | 14 | ||||
-rw-r--r-- | include/mbgl/style/layers/custom_layer.hpp | 12 | ||||
-rw-r--r-- | include/mbgl/style/layers/fill_extrusion_layer.hpp | 14 | ||||
-rw-r--r-- | include/mbgl/style/layers/fill_layer.hpp | 14 | ||||
-rw-r--r-- | include/mbgl/style/layers/heatmap_layer.hpp | 14 | ||||
-rw-r--r-- | include/mbgl/style/layers/hillshade_layer.hpp | 14 | ||||
-rw-r--r-- | include/mbgl/style/layers/layer.hpp.ejs | 14 | ||||
-rw-r--r-- | include/mbgl/style/layers/line_layer.hpp | 14 | ||||
-rw-r--r-- | include/mbgl/style/layers/raster_layer.hpp | 14 | ||||
-rw-r--r-- | include/mbgl/style/layers/symbol_layer.hpp | 14 |
11 files changed, 65 insertions, 87 deletions
diff --git a/include/mbgl/style/layers/background_layer.hpp b/include/mbgl/style/layers/background_layer.hpp index e188a9ba2c..b471d8613e 100644 --- a/include/mbgl/style/layers/background_layer.hpp +++ b/include/mbgl/style/layers/background_layer.hpp @@ -56,15 +56,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class BackgroundLayerFactory : public LayerFactory { -public: - BackgroundLayerFactory(); - ~BackgroundLayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +class BackgroundLayerFactory : 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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp index 4dacb905df..46951653b7 100644 --- a/include/mbgl/style/layers/circle_layer.hpp +++ b/include/mbgl/style/layers/circle_layer.hpp @@ -104,15 +104,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class CircleLayerFactory : public LayerFactory { -public: - CircleLayerFactory(); - ~CircleLayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/custom_layer.hpp b/include/mbgl/style/layers/custom_layer.hpp index 5021df6a60..d204a782f2 100644 --- a/include/mbgl/style/layers/custom_layer.hpp +++ b/include/mbgl/style/layers/custom_layer.hpp @@ -85,15 +85,13 @@ public: Mutable<Layer::Impl> mutableBaseImpl() const final; }; +} // namespace style + class CustomLayerFactory : public LayerFactory { -public: - CustomLayerFactory(); // LayerFactory overrides. - ~CustomLayerFactory() override; - - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; + 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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/fill_extrusion_layer.hpp b/include/mbgl/style/layers/fill_extrusion_layer.hpp index 0092e61f3b..059b8f8996 100644 --- a/include/mbgl/style/layers/fill_extrusion_layer.hpp +++ b/include/mbgl/style/layers/fill_extrusion_layer.hpp @@ -80,15 +80,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class FillExtrusionLayerFactory : public LayerFactory { -public: - FillExtrusionLayerFactory(); - ~FillExtrusionLayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp index 52bbd054ae..222142daf3 100644 --- a/include/mbgl/style/layers/fill_layer.hpp +++ b/include/mbgl/style/layers/fill_layer.hpp @@ -80,15 +80,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class FillLayerFactory : public LayerFactory { -public: - FillLayerFactory(); - ~FillLayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/heatmap_layer.hpp b/include/mbgl/style/layers/heatmap_layer.hpp index d1760100ad..004d77c487 100644 --- a/include/mbgl/style/layers/heatmap_layer.hpp +++ b/include/mbgl/style/layers/heatmap_layer.hpp @@ -69,15 +69,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class HeatmapLayerFactory : public LayerFactory { -public: - HeatmapLayerFactory(); - ~HeatmapLayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/hillshade_layer.hpp b/include/mbgl/style/layers/hillshade_layer.hpp index 978670f8a9..f840386907 100644 --- a/include/mbgl/style/layers/hillshade_layer.hpp +++ b/include/mbgl/style/layers/hillshade_layer.hpp @@ -74,15 +74,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class HillshadeLayerFactory : public LayerFactory { -public: - HillshadeLayerFactory(); - ~HillshadeLayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +class HillshadeLayerFactory : 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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs index 11d45b4b0c..84a8edd9de 100644 --- a/include/mbgl/style/layers/layer.hpp.ejs +++ b/include/mbgl/style/layers/layer.hpp.ejs @@ -72,15 +72,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class <%- camelize(type) %>LayerFactory : public LayerFactory { -public: - <%- camelize(type) %>LayerFactory(); - ~<%- camelize(type) %>LayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +class <%- camelize(type) %>LayerFactory : 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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp index 0f5e2bb347..bbc0213c53 100644 --- a/include/mbgl/style/layers/line_layer.hpp +++ b/include/mbgl/style/layers/line_layer.hpp @@ -125,15 +125,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class LineLayerFactory : public LayerFactory { -public: - LineLayerFactory(); - ~LineLayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp index 4b63570590..0def2faacd 100644 --- a/include/mbgl/style/layers/raster_layer.hpp +++ b/include/mbgl/style/layers/raster_layer.hpp @@ -86,15 +86,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class RasterLayerFactory : public LayerFactory { -public: - RasterLayerFactory(); - ~RasterLayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +class RasterLayerFactory : 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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp index 62ea393b33..e17df295f3 100644 --- a/include/mbgl/style/layers/symbol_layer.hpp +++ b/include/mbgl/style/layers/symbol_layer.hpp @@ -274,15 +274,13 @@ protected: Mutable<Layer::Impl> mutableBaseImpl() const final; }; -class SymbolLayerFactory : public LayerFactory { -public: - SymbolLayerFactory(); - ~SymbolLayerFactory() override; +} // namespace style - // LayerFactory overrides. - const LayerTypeInfo* getTypeInfo() const noexcept final; - std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final; +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<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; }; -} // namespace style } // namespace mbgl |