46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <mbgl/style/style_layer.hpp>
|
|
|
|
namespace mbgl {
|
|
|
|
class TransformState;
|
|
|
|
class CustomLayer : public StyleLayer {
|
|
public:
|
|
CustomLayer(const std::string& id,
|
|
CustomLayerInitializeFunction,
|
|
CustomLayerRenderFunction,
|
|
CustomLayerDeinitializeFunction,
|
|
void* context);
|
|
|
|
CustomLayer(const CustomLayer&);
|
|
~CustomLayer();
|
|
|
|
void initialize();
|
|
void render(const TransformState&) const;
|
|
|
|
private:
|
|
std::unique_ptr<StyleLayer> clone() const final;
|
|
|
|
void parseLayout(const JSValue&) final {}
|
|
void parsePaints(const JSValue&) final {}
|
|
|
|
void cascade(const StyleCascadeParameters&) final {}
|
|
bool recalculate(const StyleCalculationParameters&) final;
|
|
|
|
std::unique_ptr<Bucket> createBucket(StyleBucketParameters&) const final;
|
|
|
|
CustomLayerInitializeFunction initializeFn = nullptr;
|
|
CustomLayerRenderFunction renderFn = nullptr;
|
|
CustomLayerDeinitializeFunction deinitializeFn = nullptr;
|
|
void* context = nullptr;
|
|
};
|
|
|
|
template <>
|
|
inline bool StyleLayer::is<CustomLayer>() const {
|
|
return type == Type::Custom;
|
|
}
|
|
|
|
} // namespace mbgl
|