Files
MapLibreParticleLab/src/mbgl/renderer/layers/render_custom_layer.hpp
John Firebaugh be7e9bbb8d [core] Refactor CustomLayer internals
Move the responsibility for initialization/deinitialization/rendering to RenderCustomLayer. This eliminates special case code from Map and Style.
2017-06-22 08:04:39 -07:00

32 lines
855 B
C++

#pragma once
#include <mbgl/renderer/render_layer.hpp>
#include <mbgl/style/layers/custom_layer_impl.hpp>
namespace mbgl {
class RenderCustomLayer: public RenderLayer {
public:
RenderCustomLayer(Immutable<style::CustomLayer::Impl>);
~RenderCustomLayer() final;
void transition(const TransitionParameters&) final {}
void evaluate(const PropertyEvaluationParameters&) override;
bool hasTransition() const override;
std::unique_ptr<Bucket> createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) const final;
void render(Painter&, PaintParameters&, RenderSource*) final;
const style::CustomLayer::Impl& impl() const;
private:
bool initialized = false;
};
template <>
inline bool RenderLayer::is<RenderCustomLayer>() const {
return type == style::LayerType::Custom;
}
} // namespace mbgl