[core] Enable opaque pass for background layer. fix heatmap+background test.

Follow the approach from mapbox-gl-js for enabling opaque pass for background layer (same as for fill layer).

Fix combinations/heatmap-translucent--background-opaque render test.
This commit is contained in:
Aleksandar Stojiljkovic
2019-08-01 12:23:04 +03:00
parent c523391b20
commit 8103a2b028
3 changed files with 21 additions and 13 deletions

View File

@@ -47,17 +47,12 @@ void RenderFillLayer::evaluate(const PropertyEvaluationParameters& parameters) {
evaluated.get<style::FillOutlineColor>() = evaluated.get<style::FillColor>();
}
passes = RenderPass::None;
passes = RenderPass::Translucent;
if (evaluated.get<style::FillAntialias>()) {
passes |= RenderPass::Translucent;
}
if (!unevaluated.get<style::FillPattern>().isUndefined()
if (!(!unevaluated.get<style::FillPattern>().isUndefined()
|| evaluated.get<style::FillColor>().constantOr(Color()).a < 1.0f
|| evaluated.get<style::FillOpacity>().constantOr(0) < 1.0f) {
passes |= RenderPass::Translucent;
} else {
|| evaluated.get<style::FillOpacity>().constantOr(0) < 1.0f)) {
// Supply both - evaluated based on opaquePassCutoff in render().
passes |= RenderPass::Opaque;
}
properties->renderPasses = mbgl::underlying_type(passes);