diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-04-02 16:15:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-02 16:15:25 -0700 |
commit | 099fcc3b3c72b117e93d4da39ee6f70c6c5a2bc8 (patch) | |
tree | 523c8c884404f82075702b6ea707e2b2b8015089 /src/mbgl/style/layers/custom_layer_impl.hpp | |
parent | c3079c6155d7ba2a0c8dd36571f17d7652a2092e (diff) | |
download | qtlocation-mapboxgl-099fcc3b3c72b117e93d4da39ee6f70c6c5a2bc8.tar.gz |
Use a host interface for CustomLayer instead of function pointers (#11553)
Use a host interface for CustomLayer instead of function pointers
Co-authored-by: Julian Rex <julian.rex@mapbox.com>
Diffstat (limited to 'src/mbgl/style/layers/custom_layer_impl.hpp')
-rw-r--r-- | src/mbgl/style/layers/custom_layer_impl.hpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/mbgl/style/layers/custom_layer_impl.hpp b/src/mbgl/style/layers/custom_layer_impl.hpp index 62efbbe15b..a41962c276 100644 --- a/src/mbgl/style/layers/custom_layer_impl.hpp +++ b/src/mbgl/style/layers/custom_layer_impl.hpp @@ -3,6 +3,8 @@ #include <mbgl/style/layer_impl.hpp> #include <mbgl/style/layers/custom_layer.hpp> +#include <memory> + namespace mbgl { class TransformState; @@ -12,20 +14,12 @@ namespace style { class CustomLayer::Impl : public Layer::Impl { public: Impl(const std::string& id, - CustomLayerInitializeFunction, - CustomLayerRenderFunction, - CustomLayerContextLostFunction, - CustomLayerDeinitializeFunction, - void* context); + std::unique_ptr<CustomLayerHost> host); bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; - CustomLayerInitializeFunction initializeFn = nullptr; - CustomLayerRenderFunction renderFn = nullptr; - CustomLayerContextLostFunction contextLostFn = nullptr; - CustomLayerDeinitializeFunction deinitializeFn = nullptr; - void* context = nullptr; + std::shared_ptr<CustomLayerHost> host; }; } // namespace style |