Files
MapLibreParticleLab/src/mbgl/renderer/change_request.cpp
Alex Cristici 3056f28756 Hillshade layer (#1305)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tim Sylvester <tim@wetdogweather.com>
Co-authored-by: Alex Cristici <alex.cristici@gmail.com>
2023-08-31 15:36:19 +02:00

47 lines
1.7 KiB
C++

#include <mbgl/renderer/change_request.hpp>
#include <mbgl/renderer/render_orchestrator.hpp>
namespace mbgl {
AddLayerGroupRequest::AddLayerGroupRequest(LayerGroupBasePtr layerGroup_, bool canReplace)
: layerGroup(std::move(layerGroup_)),
replace(canReplace) {}
AddLayerGroupRequest::AddLayerGroupRequest(AddLayerGroupRequest &&other)
: layerGroup(std::move(other.layerGroup)) {}
void AddLayerGroupRequest::execute(RenderOrchestrator &orchestrator) {
orchestrator.addLayerGroup(std::move(layerGroup), replace);
}
void RemoveLayerGroupRequest::execute(RenderOrchestrator &orchestrator) {
orchestrator.removeLayerGroup(layerIndex);
}
UpdateLayerGroupIndexRequest::UpdateLayerGroupIndexRequest(LayerGroupBasePtr tileLayerGroup_, int32_t newLayerIndex_)
: layerGroup(std::move(tileLayerGroup_)),
newLayerIndex(newLayerIndex_) {}
void UpdateLayerGroupIndexRequest::execute(RenderOrchestrator &orchestrator) {
// Update the index of a tile layer group and indicate to the
// orchestrator that it must rebuild the map of ordered layer groups
layerGroup->updateLayerIndex(newLayerIndex);
orchestrator.markLayerGroupOrderDirty();
}
AddRenderTargetRequest::AddRenderTargetRequest(RenderTargetPtr renderTarget_)
: renderTarget(std::move(renderTarget_)) {}
void AddRenderTargetRequest::execute(RenderOrchestrator &orchestrator) {
orchestrator.addRenderTarget(std::move(renderTarget));
}
RemoveRenderTargetRequest::RemoveRenderTargetRequest(RenderTargetPtr renderTarget_)
: renderTarget(std::move(renderTarget_)) {}
void RemoveRenderTargetRequest::execute(RenderOrchestrator &orchestrator) {
orchestrator.removeRenderTarget(renderTarget);
}
} // namespace mbgl