blob: b54ac7481e29ef729529c81f66e039520f19be0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#ifndef MBGL_CUSTOM_LAYER
#define MBGL_CUSTOM_LAYER
#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
#endif
|