[core] generate masks for raster tiles to avoid painting over children

This commit is contained in:
Konstantin Käfer
2017-07-20 14:49:56 +02:00
parent 4dff51719b
commit c0efad5de2
13 changed files with 265 additions and 9 deletions

View File

@@ -135,10 +135,19 @@ void RenderRasterLayer::render(PaintParameters& parameters, RenderSource* source
parameters.context.bindTexture(*bucket.texture, 0, gl::TextureFilter::Linear);
parameters.context.bindTexture(*bucket.texture, 1, gl::TextureFilter::Linear);
draw(tile.matrix,
parameters.staticData.rasterVertexBuffer,
parameters.staticData.quadTriangleIndexBuffer,
parameters.staticData.rasterSegments);
if (bucket.vertexBuffer && bucket.indexBuffer && !bucket.segments.empty()) {
// Draw only the parts of the tile that aren't drawn by another tile in the layer.
draw(tile.matrix,
*bucket.vertexBuffer,
*bucket.indexBuffer,
bucket.segments);
} else {
// Draw the full tile.
draw(tile.matrix,
parameters.staticData.rasterVertexBuffer,
parameters.staticData.quadTriangleIndexBuffer,
parameters.staticData.rasterSegments);
}
}
}
}