diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-19 15:24:22 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-22 09:34:40 -0700 |
commit | 3afc8b4a2939da70c76dc5b2eb5d007fc917d348 (patch) | |
tree | 176372e3631a81303f379f30de235996f22212f2 /src/mbgl/layer/fill_layer.cpp | |
parent | df89de5cc5bf043ca2fe57ef4dd9a7b5d25464cb (diff) | |
download | qtlocation-mapboxgl-3afc8b4a2939da70c76dc5b2eb5d007fc917d348.tar.gz |
[core] Introduce StyleLayer subclasses
Diffstat (limited to 'src/mbgl/layer/fill_layer.cpp')
-rw-r--r-- | src/mbgl/layer/fill_layer.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mbgl/layer/fill_layer.cpp b/src/mbgl/layer/fill_layer.cpp new file mode 100644 index 0000000000..7a45774c2d --- /dev/null +++ b/src/mbgl/layer/fill_layer.cpp @@ -0,0 +1,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; +} + +} |