Drawable LayerGroup sorting, depth buffer, split view (#1173)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/renderer/change_request.hpp>
|
||||
#include <mbgl/renderer/render_layer.hpp>
|
||||
#include <mbgl/renderer/layer_group.hpp>
|
||||
#include <mbgl/renderer/paint_parameters.hpp>
|
||||
#include <mbgl/renderer/render_source.hpp>
|
||||
#include <mbgl/renderer/render_tile.hpp>
|
||||
@@ -31,6 +32,10 @@ const std::string& RenderLayer::getID() const {
|
||||
return baseImpl->id;
|
||||
}
|
||||
|
||||
int32_t RenderLayer::getLayerIndex() const noexcept {
|
||||
return layerIndex;
|
||||
}
|
||||
|
||||
bool RenderLayer::hasRenderPass(RenderPass pass) const {
|
||||
return passes & pass;
|
||||
}
|
||||
@@ -107,4 +112,32 @@ const LayerRenderData* RenderLayer::getRenderDataForPass(const RenderTile& tile,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void RenderLayer::layerIndexChanged(int32_t newLayerIndex, UniqueChangeRequestVec& changes) {
|
||||
layerIndex = newLayerIndex;
|
||||
|
||||
// Submit a change request to update the layer index of our tile layer group
|
||||
if (tileLayerGroup) {
|
||||
changes.emplace_back(std::make_unique<UpdateLayerGroupIndexRequest>(tileLayerGroup, newLayerIndex));
|
||||
}
|
||||
}
|
||||
|
||||
void RenderLayer::markLayerRenderable(bool willRender, UniqueChangeRequestVec& changes) {
|
||||
if (!tileLayerGroup) {
|
||||
return;
|
||||
}
|
||||
if (isRenderable == willRender) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This layer is either being freshly included in the renderable set or excluded
|
||||
isRenderable = willRender;
|
||||
if (willRender) {
|
||||
// The RenderTree has determined this layer should be included in the renderable set for a frame
|
||||
changes.emplace_back(std::make_unique<AddLayerGroupRequest>(tileLayerGroup, /*canReplace=*/true));
|
||||
} else {
|
||||
// The RenderTree is informing us we should not render anything
|
||||
changes.emplace_back(std::make_unique<RemoveLayerGroupRequest>(tileLayerGroup->getLayerIndex()));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user