summaryrefslogtreecommitdiff
path: root/src/mbgl/layer/fill_layer.cpp
blob: 7a45774c2dba442d9d2630588bfbef3dfb502de9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <mbgl/layer/fill_layer.hpp>

namespace mbgl {

RenderPass FillLayer::applyStyleProperties(const float z, const TimePoint& now, const ZoomHistory& zoomHistory) {
    applyStyleProperty(PropertyKey::FillAntialias, properties.antialias, z, now, zoomHistory);
    applyTransitionedStyleProperty(PropertyKey::FillOpacity, properties.opacity, z, now, zoomHistory);
    applyTransitionedStyleProperty(PropertyKey::FillColor, properties.fill_color, z, now, zoomHistory);
    applyTransitionedStyleProperty(PropertyKey::FillOutlineColor, properties.stroke_color, z, now, zoomHistory);
    applyTransitionedStyleProperty(PropertyKey::FillTranslate, properties.translate, z, now, zoomHistory);
    applyStyleProperty(PropertyKey::FillTranslateAnchor, properties.translateAnchor, z, now, zoomHistory);
    applyStyleProperty(PropertyKey::FillImage, properties.image, z, now, zoomHistory);

    RenderPass result = RenderPass::None;

    if (properties.antialias) {
        result |= RenderPass::Translucent;
    }

    if (!properties.image.from.empty() || (properties.fill_color[3] * properties.opacity) < 1.0f) {
        result |= RenderPass::Translucent;
    } else {
        result |= RenderPass::Opaque;
    }

    return result;
}

}