diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-07-10 15:51:35 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-07-10 15:51:35 -0700 |
commit | 9846cb75f4dbb3f64dcda635e7338187b5e5b3eb (patch) | |
tree | 01c65b15b24d745410583fe4ade4146513a0b2e2 | |
parent | f519625ed2ab5a88c86dfa6d833059023e2996b0 (diff) | |
download | qtlocation-mapboxgl-9846cb75f4dbb3f64dcda635e7338187b5e5b3eb.tar.gz |
remove *-enabled
refs mapbox/mapbox-gl-style-spec#94
-rw-r--r-- | include/llmr/style/property_key.hpp | 6 | ||||
-rw-r--r-- | include/llmr/style/style_properties.hpp | 18 | ||||
-rw-r--r-- | src/renderer/painter_fill.cpp | 1 | ||||
-rw-r--r-- | src/renderer/painter_icon.cpp | 1 | ||||
-rw-r--r-- | src/renderer/painter_line.cpp | 1 | ||||
-rw-r--r-- | src/renderer/painter_raster.cpp | 1 | ||||
-rw-r--r-- | src/renderer/painter_text.cpp | 1 | ||||
-rw-r--r-- | src/style/property_fallback.cpp | 6 | ||||
-rw-r--r-- | src/style/style_layer.cpp | 6 | ||||
-rw-r--r-- | src/style/style_parser.cpp | 12 |
10 files changed, 6 insertions, 47 deletions
diff --git a/include/llmr/style/property_key.hpp b/include/llmr/style/property_key.hpp index 47d0d2b78b..e52c33ad17 100644 --- a/include/llmr/style/property_key.hpp +++ b/include/llmr/style/property_key.hpp @@ -4,7 +4,6 @@ namespace llmr { enum class PropertyKey { - FillEnabled, FillAntialias, FillOpacity, FillColor, @@ -15,7 +14,6 @@ enum class PropertyKey { FillTranslateAnchor, FillImage, - LineEnabled, LineOpacity, LineColor, LineTranslate, // for transitions only @@ -30,12 +28,10 @@ enum class PropertyKey { LineDashGap, LineImage, - IconEnabled, IconOpacity, IconRotate, IconRotateAnchor, - TextEnabled, TextOpacity, TextSize, TextColor, @@ -43,10 +39,8 @@ enum class PropertyKey { TextHaloWidth, TextHaloBlur, - CompositeEnabled, CompositeOpacity, - RasterEnabled, RasterOpacity, RasterSpin, RasterBrightnessLow, diff --git a/include/llmr/style/style_properties.hpp b/include/llmr/style/style_properties.hpp index 71758563ae..bc46e2d854 100644 --- a/include/llmr/style/style_properties.hpp +++ b/include/llmr/style/style_properties.hpp @@ -14,7 +14,6 @@ namespace llmr { struct FillProperties { FillProperties() {} - bool enabled = true; bool antialias = true; float opacity = 1.0f; Color fill_color = {{ 0, 0, 0, 1 }}; @@ -24,13 +23,12 @@ struct FillProperties { std::string image; inline bool isVisible() const { - return enabled && opacity > 0 && (fill_color[3] > 0 || stroke_color[3] > 0); + return opacity > 0 && (fill_color[3] > 0 || stroke_color[3] > 0); } }; struct LineProperties { inline LineProperties() {} - bool enabled = true; float opacity = 1.0f; Color color = {{ 0, 0, 0, 1 }}; std::array<float, 2> translate = {{ 0, 0 }}; @@ -42,25 +40,23 @@ struct LineProperties { std::string image; inline bool isVisible() const { - return enabled && opacity > 0 && color[3] > 0 && width > 0; + return opacity > 0 && color[3] > 0 && width > 0; } }; struct IconProperties { inline IconProperties() {} - bool enabled = true; float opacity = 1.0f; float rotate = 0.0f; RotateAnchorType rotate_anchor = RotateAnchorType::Default; inline bool isVisible() const { - return enabled && opacity > 0; + return opacity > 0; } }; struct TextProperties { inline TextProperties() {} - bool enabled = true; float opacity = 1.0f; float size = 12.0f; Color color = {{ 0, 0, 0, 1 }}; @@ -69,23 +65,21 @@ struct TextProperties { float halo_blur = 1.0f; inline bool isVisible() const { - return enabled && opacity > 0 && (color[3] > 0 || halo_color[3] > 0) && size > 0; + return opacity > 0 && (color[3] > 0 || halo_color[3] > 0) && size > 0; } }; struct CompositeProperties { inline CompositeProperties() {} - bool enabled = true; float opacity = 1.0f; inline bool isVisible() const { - return enabled && opacity > 0; + return opacity > 0; } }; struct RasterProperties { inline RasterProperties() {} - bool enabled = true; float opacity = 1.0f; float spin = 0.0f; std::array<float, 2> brightness = {{ 0, 1 }}; @@ -94,7 +88,7 @@ struct RasterProperties { float fade = 0.0f; inline bool isVisible() const { - return enabled && opacity > 0; + return opacity > 0; } }; diff --git a/src/renderer/painter_fill.cpp b/src/renderer/painter_fill.cpp index f43ceed9f6..18b370bc89 100644 --- a/src/renderer/painter_fill.cpp +++ b/src/renderer/painter_fill.cpp @@ -150,7 +150,6 @@ void Painter::renderFill(FillBucket& bucket, std::shared_ptr<StyleLayer> layer_d if (!bucket.hasData()) return; const FillProperties &properties = layer_desc->getProperties<FillProperties>(); - if (!properties.enabled) return; if (layer_desc->rasterize && layer_desc->rasterize->isEnabled(id.z)) { if (pass == Translucent) { diff --git a/src/renderer/painter_icon.cpp b/src/renderer/painter_icon.cpp index 59ae67746e..3a0192118c 100644 --- a/src/renderer/painter_icon.cpp +++ b/src/renderer/painter_icon.cpp @@ -14,7 +14,6 @@ void Painter::renderIcon(IconBucket& bucket, std::shared_ptr<StyleLayer> layer_d if (pass == Opaque) return; const IconProperties &properties = layer_desc->getProperties<IconProperties>(); - if (!properties.enabled) return; // TODO: when translating icon, are we doing this in the bucket already? // const mat4 &vtxMatrix = translatedMatrix(properties.translate, id, properties.translateAnchor); diff --git a/src/renderer/painter_line.cpp b/src/renderer/painter_line.cpp index 990c80b89c..a5ed68cc0f 100644 --- a/src/renderer/painter_line.cpp +++ b/src/renderer/painter_line.cpp @@ -11,7 +11,6 @@ void Painter::renderLine(LineBucket& bucket, std::shared_ptr<StyleLayer> layer_d if (!bucket.hasData()) return; const LineProperties &properties = layer_desc->getProperties<LineProperties>(); - if (!properties.enabled) return; float width = properties.width; float offset = properties.offset / 2; diff --git a/src/renderer/painter_raster.cpp b/src/renderer/painter_raster.cpp index 8f330898da..bbd4c36d92 100644 --- a/src/renderer/painter_raster.cpp +++ b/src/renderer/painter_raster.cpp @@ -9,7 +9,6 @@ void Painter::renderRaster(RasterBucket& bucket, std::shared_ptr<StyleLayer> lay if (pass == Translucent) return; const RasterProperties &properties = layer_desc->getProperties<RasterProperties>(); - if (!properties.enabled) return; depthMask(false); diff --git a/src/renderer/painter_text.cpp b/src/renderer/painter_text.cpp index d9db72d66b..1f6d763974 100644 --- a/src/renderer/painter_text.cpp +++ b/src/renderer/painter_text.cpp @@ -12,7 +12,6 @@ void Painter::renderText(TextBucket& bucket, std::shared_ptr<StyleLayer> layer_d if (!bucket.hasData()) return; const TextProperties &properties = layer_desc->getProperties<TextProperties>(); - if (!properties.enabled) return; mat4 exMatrix; matrix::copy(exMatrix, projMatrix); diff --git a/src/style/property_fallback.cpp b/src/style/property_fallback.cpp index 0560ba299f..38eae89c51 100644 --- a/src/style/property_fallback.cpp +++ b/src/style/property_fallback.cpp @@ -3,7 +3,6 @@ namespace llmr { const std::map<PropertyKey, PropertyValue> PropertyFallbackValue::properties = { - { PropertyKey::FillEnabled, true }, { PropertyKey::FillAntialias, true }, { PropertyKey::FillOpacity, 1.0f }, { PropertyKey::FillColor, Color({{ 0, 0, 0, 1 }}) }, @@ -11,7 +10,6 @@ const std::map<PropertyKey, PropertyValue> PropertyFallbackValue::properties = { { PropertyKey::FillTranslateY, 0.0f }, { PropertyKey::FillTranslateAnchor, TranslateAnchorType::Map }, - { PropertyKey::LineEnabled, true }, { PropertyKey::LineOpacity, 1.0f }, { PropertyKey::LineColor, Color({{ 0, 0, 0, 1 }}) }, { PropertyKey::LineTranslateX, 0.0f }, @@ -23,12 +21,10 @@ const std::map<PropertyKey, PropertyValue> PropertyFallbackValue::properties = { { PropertyKey::LineDashLand, 1.0f }, { PropertyKey::LineDashGap, -1.0f }, - { PropertyKey::IconEnabled, true }, { PropertyKey::IconOpacity, 1.0f }, { PropertyKey::IconRotate, 0.0f }, { PropertyKey::IconRotateAnchor, RotateAnchorType::Viewport }, - { PropertyKey::TextEnabled, true }, { PropertyKey::TextOpacity, 1.0f }, { PropertyKey::TextSize, 16.0f }, { PropertyKey::TextColor, Color({{ 0, 0, 0, 1 }}) }, @@ -36,10 +32,8 @@ const std::map<PropertyKey, PropertyValue> PropertyFallbackValue::properties = { { PropertyKey::TextHaloWidth, 0.25f }, { PropertyKey::TextHaloBlur, 1.0f }, - { PropertyKey::CompositeEnabled, true }, { PropertyKey::CompositeOpacity, 1.0f }, - { PropertyKey::RasterEnabled, true }, { PropertyKey::RasterOpacity, 1.0f }, { PropertyKey::RasterSpin, 0.0f }, { PropertyKey::RasterBrightnessLow, 0.0f }, diff --git a/src/style/style_layer.cpp b/src/style/style_layer.cpp index 4bbf1812d5..8eedd04351 100644 --- a/src/style/style_layer.cpp +++ b/src/style/style_layer.cpp @@ -164,7 +164,6 @@ template <> void StyleLayer::applyStyleProperties<FillProperties>(const float z, const timestamp now) { properties.set<FillProperties>(); FillProperties &fill = properties.get<FillProperties>(); - applyStyleProperty(PropertyKey::FillEnabled, fill.enabled, z, now); applyStyleProperty(PropertyKey::FillAntialias, fill.antialias, z, now); applyStyleProperty(PropertyKey::FillOpacity, fill.opacity, z, now); applyStyleProperty(PropertyKey::FillColor, fill.fill_color, z, now); @@ -179,7 +178,6 @@ template <> void StyleLayer::applyStyleProperties<LineProperties>(const float z, const timestamp now) { properties.set<LineProperties>(); LineProperties &line = properties.get<LineProperties>(); - applyStyleProperty(PropertyKey::LineEnabled, line.enabled, z, now); applyStyleProperty(PropertyKey::LineOpacity, line.opacity, z, now); applyStyleProperty(PropertyKey::LineColor, line.color, z, now); applyStyleProperty(PropertyKey::LineTranslateX, line.translate[0], z, now); @@ -197,7 +195,6 @@ template <> void StyleLayer::applyStyleProperties<IconProperties>(const float z, const timestamp now) { properties.set<IconProperties>(); IconProperties &icon = properties.get<IconProperties>(); - applyStyleProperty(PropertyKey::IconEnabled, icon.enabled, z, now); applyStyleProperty(PropertyKey::IconOpacity, icon.opacity, z, now); applyStyleProperty(PropertyKey::IconRotate, icon.rotate, z, now); applyStyleProperty(PropertyKey::IconRotateAnchor, icon.rotate_anchor, z, now); @@ -207,7 +204,6 @@ template <> void StyleLayer::applyStyleProperties<TextProperties>(const float z, const timestamp now) { properties.set<TextProperties>(); TextProperties &text = properties.get<TextProperties>(); - applyStyleProperty(PropertyKey::TextEnabled, text.enabled, z, now); applyStyleProperty(PropertyKey::TextOpacity, text.opacity, z, now); applyStyleProperty(PropertyKey::TextSize, text.size, z, now); applyStyleProperty(PropertyKey::TextColor, text.color, z, now); @@ -220,7 +216,6 @@ template <> void StyleLayer::applyStyleProperties<CompositeProperties>(const float z, const timestamp now) { properties.set<CompositeProperties>(); CompositeProperties &composite = properties.get<CompositeProperties>(); - applyStyleProperty(PropertyKey::CompositeEnabled, composite.enabled, z, now); applyStyleProperty(PropertyKey::CompositeOpacity, composite.opacity, z, now); } @@ -228,7 +223,6 @@ template <> void StyleLayer::applyStyleProperties<RasterProperties>(const float z, const timestamp now) { properties.set<RasterProperties>(); RasterProperties &raster = properties.get<RasterProperties>(); - applyStyleProperty(PropertyKey::RasterEnabled, raster.enabled, z, now); applyStyleProperty(PropertyKey::RasterOpacity, raster.opacity, z, now); applyStyleProperty(PropertyKey::RasterSpin, raster.spin, z, now); applyStyleProperty(PropertyKey::RasterBrightnessLow, raster.brightness[0], z, now); diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp index 2b8339a532..539740c6cb 100644 --- a/src/style/style_parser.cpp +++ b/src/style/style_parser.cpp @@ -600,8 +600,6 @@ void StyleParser::parseStyles(JSVal value, std::map<ClassID, ClassProperties> &s void StyleParser::parseStyle(JSVal value, ClassProperties &klass) { using Key = PropertyKey; - parseOptionalProperty<Function<bool>>("fill-enabled", Key::FillEnabled, klass, value); - parseOptionalProperty<PropertyTransition>("transition-fill-enabled", Key::FillEnabled, klass, value); parseOptionalProperty<Function<bool>>("fill-antialias", Key::FillAntialias, klass, value); parseOptionalProperty<Function<float>>("fill-opacity", Key::FillOpacity, klass, value); parseOptionalProperty<PropertyTransition>("transition-fill-opacity", Key::FillOpacity, klass, value); @@ -614,8 +612,6 @@ void StyleParser::parseStyle(JSVal value, ClassProperties &klass) { parseOptionalProperty<TranslateAnchorType>("fill-translate-anchor", Key::FillTranslateAnchor, klass, value); parseOptionalProperty<std::string>("fill-image", Key::FillImage, klass, value); - parseOptionalProperty<Function<bool>>("line-enabled", Key::LineEnabled, klass, value); - parseOptionalProperty<PropertyTransition>("transition-line-enabled", Key::LineEnabled, klass, value); parseOptionalProperty<Function<float>>("line-opacity", Key::LineOpacity, klass, value); parseOptionalProperty<PropertyTransition>("transition-line-opacity", Key::LineOpacity, klass, value); parseOptionalProperty<Function<Color>>("line-color", Key::LineColor, klass, value); @@ -633,15 +629,11 @@ void StyleParser::parseStyle(JSVal value, ClassProperties &klass) { parseOptionalProperty<PropertyTransition>("transition-line-dasharray", Key::LineDashArray, klass, value); parseOptionalProperty<std::string>("line-image", Key::LineImage, klass, value); - parseOptionalProperty<Function<bool>>("icon-enabled", Key::IconEnabled, klass, value); - parseOptionalProperty<PropertyTransition>("transition-icon-enabled", Key::IconEnabled, klass, value); parseOptionalProperty<Function<float>>("icon-opacity", Key::IconOpacity, klass, value); parseOptionalProperty<PropertyTransition>("transition-icon-opacity", Key::IconOpacity, klass, value); parseOptionalProperty<Function<float>>("icon-rotate", Key::IconRotate, klass, value); parseOptionalProperty<RotateAnchorType>("icon-rotate-anchor", Key::IconRotateAnchor, klass, value); - parseOptionalProperty<Function<bool>>("text-enabled", Key::TextEnabled, klass, value); - parseOptionalProperty<PropertyTransition>("transition-text-enabled", Key::TextEnabled, klass, value); parseOptionalProperty<Function<float>>("text-opacity", Key::TextOpacity, klass, value); parseOptionalProperty<PropertyTransition>("transition-text-opacity", Key::TextOpacity, klass, value); parseOptionalProperty<Function<float>>("text-size", Key::TextSize, klass, value); @@ -655,13 +647,9 @@ void StyleParser::parseStyle(JSVal value, ClassProperties &klass) { parseOptionalProperty<Function<float>>("text-halo-blur", Key::TextHaloBlur, klass, value); parseOptionalProperty<PropertyTransition>("transition-text-halo-blur", Key::TextHaloBlur, klass, value); - parseOptionalProperty<Function<bool>>("composite-enabled", Key::CompositeEnabled, klass, value); - parseOptionalProperty<PropertyTransition>("transition-composite-enabled", Key::CompositeEnabled, klass, value); parseOptionalProperty<Function<float>>("composite-opacity", Key::CompositeOpacity, klass, value); parseOptionalProperty<PropertyTransition>("transition-composite-opacity", Key::CompositeOpacity, klass, value); - parseOptionalProperty<Function<bool>>("raster-enabled", Key::RasterEnabled, klass, value); - parseOptionalProperty<PropertyTransition>("transition-raster-enabled", Key::RasterEnabled, klass, value); parseOptionalProperty<Function<float>>("raster-opacity", Key::RasterOpacity, klass, value); parseOptionalProperty<PropertyTransition>("transition-raster-opacity", Key::RasterOpacity, klass, value); parseOptionalProperty<Function<float>>("raster-spin", Key::RasterSpin, klass, value); |