diff options
author | Thomas Moenicke <thomas.moenicke@mapbox.com> | 2020-02-03 19:10:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 19:10:57 +0200 |
commit | b64ed754442b894f3914a4191798fbd2f2bc8cd9 (patch) | |
tree | 59bb14829d7cdd5f2466dad4cffb74c4d1b80068 /src/mbgl/style | |
parent | 2e10d3548a8b3aff1f28b9514594c3c14509f084 (diff) | |
download | qtlocation-mapboxgl-b64ed754442b894f3914a4191798fbd2f2bc8cd9.tar.gz |
[build] Adding a build flag to build without GL if needed (#16120)
* [build] Adding a build flag to build without GL if needed
* [build] Moving custom layer to mbgl/gl
Diffstat (limited to 'src/mbgl/style')
-rw-r--r-- | src/mbgl/style/layers/custom_layer.cpp | 60 | ||||
-rw-r--r-- | src/mbgl/style/layers/custom_layer_impl.cpp | 20 | ||||
-rw-r--r-- | src/mbgl/style/layers/custom_layer_impl.hpp | 35 | ||||
-rw-r--r-- | src/mbgl/style/style_impl.cpp | 2 |
4 files changed, 1 insertions, 116 deletions
diff --git a/src/mbgl/style/layers/custom_layer.cpp b/src/mbgl/style/layers/custom_layer.cpp deleted file mode 100644 index 30bb2d220e..0000000000 --- a/src/mbgl/style/layers/custom_layer.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include <mbgl/style/layers/custom_layer.hpp> -#include <mbgl/style/layers/custom_layer_impl.hpp> -#include <mbgl/style/layer_observer.hpp> - -#include <mbgl/renderer/layers/render_custom_layer.hpp> - -namespace mbgl { -namespace style { - -namespace { -const LayerTypeInfo typeInfoCustom{"", - LayerTypeInfo::Source::NotRequired, - LayerTypeInfo::Pass3D::NotRequired, - LayerTypeInfo::Layout::NotRequired, - LayerTypeInfo::FadingTiles::NotRequired, - LayerTypeInfo::CrossTileIndex::NotRequired, - LayerTypeInfo::TileKind::NotRequired}; -} // namespace - -CustomLayer::CustomLayer(const std::string& layerID, - std::unique_ptr<CustomLayerHost> host) - : Layer(makeMutable<Impl>(layerID, std::move(host))) { -} - -CustomLayer::~CustomLayer() = default; - -const CustomLayer::Impl& CustomLayer::impl() const { - return static_cast<const Impl&>(*baseImpl); -} - -Mutable<CustomLayer::Impl> CustomLayer::mutableImpl() const { - return makeMutable<Impl>(impl()); -} - -std::unique_ptr<Layer> CustomLayer::cloneRef(const std::string&) const { - assert(false); - return nullptr; -} - -using namespace conversion; - -optional<Error> CustomLayer::setProperty(const std::string&, const Convertible&) { - return Error { "layer doesn't support this property" }; -} - -StyleProperty CustomLayer::getProperty(const std::string&) const { - return {}; -} - -Mutable<Layer::Impl> CustomLayer::mutableBaseImpl() const { - return staticMutableCast<Layer::Impl>(mutableImpl()); -} - -// static -const LayerTypeInfo* CustomLayer::Impl::staticTypeInfo() noexcept { - return &typeInfoCustom; -} - -} // namespace style -} // namespace mbgl diff --git a/src/mbgl/style/layers/custom_layer_impl.cpp b/src/mbgl/style/layers/custom_layer_impl.cpp deleted file mode 100644 index f82cb1ea2c..0000000000 --- a/src/mbgl/style/layers/custom_layer_impl.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include <mbgl/style/layers/custom_layer_impl.hpp> - -namespace mbgl { -namespace style { - -CustomLayer::Impl::Impl(const std::string& id_, - std::unique_ptr<CustomLayerHost> host_) - : Layer::Impl(id_, std::string()) { - host = std::move(host_); -} - -bool CustomLayer::Impl::hasLayoutDifference(const Layer::Impl&) const { - return false; -} - -void CustomLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const { -} - -} // namespace style -} // namespace mbgl diff --git a/src/mbgl/style/layers/custom_layer_impl.hpp b/src/mbgl/style/layers/custom_layer_impl.hpp deleted file mode 100644 index d8b8a7f286..0000000000 --- a/src/mbgl/style/layers/custom_layer_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include <mbgl/style/layer_impl.hpp> -#include <mbgl/style/layer_properties.hpp> -#include <mbgl/style/layers/custom_layer.hpp> - -#include <memory> - -namespace mbgl { - -class TransformState; - -namespace style { - -class CustomLayer::Impl : public Layer::Impl { -public: - Impl(const std::string& id, - std::unique_ptr<CustomLayerHost> host); - - bool hasLayoutDifference(const Layer::Impl&) const override; - void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; - - std::shared_ptr<CustomLayerHost> host; - - DECLARE_LAYER_TYPE_INFO; -}; - -class CustomLayerProperties final : public LayerProperties { -public: - explicit CustomLayerProperties(Immutable<CustomLayer::Impl> impl) - : LayerProperties(std::move(impl)) {} -}; - -} // namespace style -} // namespace mbgl diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp index d5961b5901..5b52f1d72c 100644 --- a/src/mbgl/style/style_impl.cpp +++ b/src/mbgl/style/style_impl.cpp @@ -1,3 +1,4 @@ +#include <mbgl/gl/custom_layer.hpp> #include <mbgl/sprite/sprite_loader.hpp> #include <mbgl/storage/file_source.hpp> #include <mbgl/storage/resource.hpp> @@ -6,7 +7,6 @@ #include <mbgl/style/layer_impl.hpp> #include <mbgl/style/layers/background_layer.hpp> #include <mbgl/style/layers/circle_layer.hpp> -#include <mbgl/style/layers/custom_layer.hpp> #include <mbgl/style/layers/fill_extrusion_layer.hpp> #include <mbgl/style/layers/fill_layer.hpp> #include <mbgl/style/layers/heatmap_layer.hpp> |