summaryrefslogtreecommitdiff
path: root/src/mbgl/layermanager/background_layer_factory.cpp
blob: b20e9a1930a0fcbd49af97857fc885a100f8ffd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <mbgl/layermanager/background_layer_factory.hpp>

#include <mbgl/renderer/layers/render_background_layer.hpp>
#include <mbgl/style/layers/background_layer.hpp>
#include <mbgl/style/layers/background_layer_impl.hpp>

namespace mbgl {

const style::LayerTypeInfo* BackgroundLayerFactory::getTypeInfo() const noexcept {
    return style::BackgroundLayer::Impl::staticTypeInfo();
}

std::unique_ptr<style::Layer> BackgroundLayerFactory::createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept {
    (void)value;
    return std::unique_ptr<style::Layer>(new style::BackgroundLayer(id));
}

std::unique_ptr<RenderLayer> BackgroundLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
    assert(impl->getTypeInfo() == getTypeInfo());
    return std::make_unique<RenderBackgroundLayer>(staticImmutableCast<style::BackgroundLayer::Impl>(impl));
}

} // namespace mbgl