From a48152a9811a856e467eff3e396a76a059558fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 2 May 2019 15:16:09 +0200 Subject: [build] change special casing for LineFloorWidth in shader generation --- src/mbgl/style/layers/layer_properties.hpp.ejs | 13 +++---------- src/mbgl/style/layers/line_layer_properties.hpp | 14 +++++++------- 2 files changed, 10 insertions(+), 17 deletions(-) (limited to 'src/mbgl/style/layers') diff --git a/src/mbgl/style/layers/layer_properties.hpp.ejs b/src/mbgl/style/layers/layer_properties.hpp.ejs index 11a1db33c7..277cfd173b 100644 --- a/src/mbgl/style/layers/layer_properties.hpp.ejs +++ b/src/mbgl/style/layers/layer_properties.hpp.ejs @@ -33,19 +33,15 @@ struct <%- camelize(property.name) %> : ColorRampProperty { <% } else { -%> struct <%- camelize(property.name) %> : <%- paintPropertyType(property, type) %> { static <%- evaluatedType(property) %> defaultValue() { return <%- defaultValue(property) %>; } +<% if (property.name === 'line-floor-width') { -%> + using EvaluatorType = DataDrivenPropertyEvaluator; +<% } -%> <% if (isOverridable(property)) { -%> static constexpr const char *name() { return "<%- property.name %>"; } static constexpr auto expressionType() { return expression::type::<%- expressionType(property) %>{}; }; template static bool hasOverride(const T& t) { return !!t.<%- camelizeWithLeadingLowercase(property.name) %>; }; <% } -%> }; -<% if (property.name === 'line-width') { -%> - -struct LineFloorWidth : DataDrivenPaintProperty { - using EvaluatorType = DataDrivenPropertyEvaluator; - static float defaultValue() { return 1.0f; } -}; -<% } -%> <% } -%> <% } -%> @@ -61,9 +57,6 @@ class <%- camelize(type) %>LayoutProperties : public Properties< class <%- camelize(type) %>PaintProperties : public Properties< <% for (const property of paintProperties.slice(0, -1)) { -%> <%- camelize(property.name) %>, -<% if (property.name === 'line-width') { -%> - LineFloorWidth, -<% } -%> <% } -%> <%- camelize(paintProperties.slice(-1)[0].name) %> > {}; diff --git a/src/mbgl/style/layers/line_layer_properties.hpp b/src/mbgl/style/layers/line_layer_properties.hpp index 5fcbecf3be..24a6c13675 100644 --- a/src/mbgl/style/layers/line_layer_properties.hpp +++ b/src/mbgl/style/layers/line_layer_properties.hpp @@ -54,11 +54,6 @@ struct LineWidth : DataDrivenPaintProperty { - using EvaluatorType = DataDrivenPropertyEvaluator; - static float defaultValue() { return 1.0f; } -}; - struct LineGapWidth : DataDrivenPaintProperty { static float defaultValue() { return 0; } }; @@ -82,6 +77,11 @@ struct LinePattern : CrossFadedDataDrivenPaintProperty { + static float defaultValue() { return 1; } + using EvaluatorType = DataDrivenPropertyEvaluator; +}; + class LineLayoutProperties : public Properties< LineCap, LineJoin, @@ -95,13 +95,13 @@ class LinePaintProperties : public Properties< LineTranslate, LineTranslateAnchor, LineWidth, - LineFloorWidth, LineGapWidth, LineOffset, LineBlur, LineDasharray, LinePattern, - LineGradient + LineGradient, + LineFloorWidth > {}; class LineLayerProperties final : public LayerProperties { -- cgit v1.2.1