[core] Fix assertion at RenderRasterLayer::prepare()
It shall consider that image data might not be available until the source loads it.
This commit is contained in:
@@ -77,12 +77,14 @@ static std::array<float, 3> spinWeights(float spin) {
|
||||
void RenderRasterLayer::prepare(const LayerPrepareParameters& params) {
|
||||
renderTiles = params.source->getRenderTiles();
|
||||
imageData = params.source->getImageRenderData();
|
||||
assert(renderTiles || imageData);
|
||||
// It is possible image data is not available until the source loads it.
|
||||
assert(renderTiles || imageData || !params.source->isEnabled());
|
||||
}
|
||||
|
||||
void RenderRasterLayer::render(PaintParameters& parameters) {
|
||||
if (parameters.pass != RenderPass::Translucent)
|
||||
if (parameters.pass != RenderPass::Translucent || (!renderTiles && !imageData)) {
|
||||
return;
|
||||
}
|
||||
const auto& evaluated = static_cast<const RasterLayerProperties&>(*evaluatedProperties).evaluated;
|
||||
RasterProgram::Binders paintAttributeData{ evaluated, 0 };
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ bool RenderLayer::supportsZoom(float zoom) const {
|
||||
|
||||
void RenderLayer::prepare(const LayerPrepareParameters& params) {
|
||||
assert(params.source);
|
||||
assert(params.source->isEnabled());
|
||||
renderTiles = params.source->getRenderTiles();
|
||||
addRenderPassesFromTiles();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user