diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-25 00:01:59 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-26 11:57:39 +0300 |
commit | 1d6660b5521b9f67afad8bcfe6a6b649c8b3c317 (patch) | |
tree | 303e46ae40b6424780b595a3291a9269a9aa5648 | |
parent | c2dc873cf9c026e964d1d73a2c8301d21509da6e (diff) | |
download | qtlocation-mapboxgl-1d6660b5521b9f67afad8bcfe6a6b649c8b3c317.tar.gz |
[core] Fix clang format errors
-rw-r--r-- | src/mbgl/style/layers/background_layer.cpp | 40 | ||||
-rw-r--r-- | src/mbgl/style/layers/circle_layer.cpp | 120 | ||||
-rw-r--r-- | src/mbgl/style/layers/fill_extrusion_layer.cpp | 90 | ||||
-rw-r--r-- | src/mbgl/style/layers/fill_layer.cpp | 80 | ||||
-rw-r--r-- | src/mbgl/style/layers/heatmap_layer.cpp | 60 | ||||
-rw-r--r-- | src/mbgl/style/layers/hillshade_layer.cpp | 70 | ||||
-rw-r--r-- | src/mbgl/style/layers/layer.cpp.ejs | 22 | ||||
-rw-r--r-- | src/mbgl/style/layers/line_layer.cpp | 120 | ||||
-rw-r--r-- | src/mbgl/style/layers/raster_layer.cpp | 90 | ||||
-rw-r--r-- | src/mbgl/style/layers/symbol_layer.cpp | 150 |
10 files changed, 441 insertions, 401 deletions
diff --git a/src/mbgl/style/layers/background_layer.cpp b/src/mbgl/style/layers/background_layer.cpp index 4c37022e70..735d653e85 100644 --- a/src/mbgl/style/layers/background_layer.cpp +++ b/src/mbgl/style/layers/background_layer.cpp @@ -159,20 +159,25 @@ enum class Property { BackgroundPatternTransition, }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {{"background-color", mbgl::underlying_type(Property::BackgroundColor)}, - {"background-opacity", mbgl::underlying_type(Property::BackgroundOpacity)}, - {"background-pattern", mbgl::underlying_type(Property::BackgroundPattern)}, - {"background-color-transition", mbgl::underlying_type(Property::BackgroundColorTransition)}, - {"background-opacity-transition", mbgl::underlying_type(Property::BackgroundOpacityTransition)}, - {"background-pattern-transition", mbgl::underlying_type(Property::BackgroundPatternTransition)}}); + {{"background-color", toUint8(Property::BackgroundColor)}, + {"background-opacity", toUint8(Property::BackgroundOpacity)}, + {"background-pattern", toUint8(Property::BackgroundPattern)}, + {"background-color-transition", toUint8(Property::BackgroundColorTransition)}, + {"background-opacity-transition", toUint8(Property::BackgroundOpacityTransition)}, + {"background-pattern-transition", toUint8(Property::BackgroundPatternTransition)}}); } // namespace optional<Error> BackgroundLayer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -220,24 +225,23 @@ optional<Error> BackgroundLayer::setPaintProperty(const std::string& name, const if (!transition) { return error; } - + if (property == Property::BackgroundColorTransition) { setBackgroundColorTransition(*transition); return nullopt; } - + if (property == Property::BackgroundOpacityTransition) { setBackgroundOpacityTransition(*transition); return nullopt; } - + if (property == Property::BackgroundPatternTransition) { setBackgroundPatternTransition(*transition); return nullopt; } - - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } LayerProperty BackgroundLayer::getPaintProperty(const std::string& name) const { @@ -248,17 +252,17 @@ LayerProperty BackgroundLayer::getPaintProperty(const std::string& name) const { switch (static_cast<Property>(it->second)) { case Property::BackgroundColor: - return conversion::makeLayerProperty(getBackgroundColor()); + return makeLayerProperty(getBackgroundColor()); case Property::BackgroundOpacity: - return conversion::makeLayerProperty(getBackgroundOpacity()); + return makeLayerProperty(getBackgroundOpacity()); case Property::BackgroundPattern: - return conversion::makeLayerProperty(getBackgroundPattern()); + return makeLayerProperty(getBackgroundPattern()); case Property::BackgroundColorTransition: - return conversion::makeLayerProperty(getBackgroundColorTransition()); + return makeLayerProperty(getBackgroundColorTransition()); case Property::BackgroundOpacityTransition: - return conversion::makeLayerProperty(getBackgroundOpacityTransition()); + return makeLayerProperty(getBackgroundOpacityTransition()); case Property::BackgroundPatternTransition: - return conversion::makeLayerProperty(getBackgroundPatternTransition()); + return makeLayerProperty(getBackgroundPatternTransition()); } return {}; } diff --git a/src/mbgl/style/layers/circle_layer.cpp b/src/mbgl/style/layers/circle_layer.cpp index 3fec7fd677..73171713b8 100644 --- a/src/mbgl/style/layers/circle_layer.cpp +++ b/src/mbgl/style/layers/circle_layer.cpp @@ -391,36 +391,41 @@ enum class Property { CircleTranslateAnchorTransition, }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {{"circle-blur", mbgl::underlying_type(Property::CircleBlur)}, - {"circle-color", mbgl::underlying_type(Property::CircleColor)}, - {"circle-opacity", mbgl::underlying_type(Property::CircleOpacity)}, - {"circle-pitch-alignment", mbgl::underlying_type(Property::CirclePitchAlignment)}, - {"circle-pitch-scale", mbgl::underlying_type(Property::CirclePitchScale)}, - {"circle-radius", mbgl::underlying_type(Property::CircleRadius)}, - {"circle-stroke-color", mbgl::underlying_type(Property::CircleStrokeColor)}, - {"circle-stroke-opacity", mbgl::underlying_type(Property::CircleStrokeOpacity)}, - {"circle-stroke-width", mbgl::underlying_type(Property::CircleStrokeWidth)}, - {"circle-translate", mbgl::underlying_type(Property::CircleTranslate)}, - {"circle-translate-anchor", mbgl::underlying_type(Property::CircleTranslateAnchor)}, - {"circle-blur-transition", mbgl::underlying_type(Property::CircleBlurTransition)}, - {"circle-color-transition", mbgl::underlying_type(Property::CircleColorTransition)}, - {"circle-opacity-transition", mbgl::underlying_type(Property::CircleOpacityTransition)}, - {"circle-pitch-alignment-transition", mbgl::underlying_type(Property::CirclePitchAlignmentTransition)}, - {"circle-pitch-scale-transition", mbgl::underlying_type(Property::CirclePitchScaleTransition)}, - {"circle-radius-transition", mbgl::underlying_type(Property::CircleRadiusTransition)}, - {"circle-stroke-color-transition", mbgl::underlying_type(Property::CircleStrokeColorTransition)}, - {"circle-stroke-opacity-transition", mbgl::underlying_type(Property::CircleStrokeOpacityTransition)}, - {"circle-stroke-width-transition", mbgl::underlying_type(Property::CircleStrokeWidthTransition)}, - {"circle-translate-transition", mbgl::underlying_type(Property::CircleTranslateTransition)}, - {"circle-translate-anchor-transition", mbgl::underlying_type(Property::CircleTranslateAnchorTransition)}}); + {{"circle-blur", toUint8(Property::CircleBlur)}, + {"circle-color", toUint8(Property::CircleColor)}, + {"circle-opacity", toUint8(Property::CircleOpacity)}, + {"circle-pitch-alignment", toUint8(Property::CirclePitchAlignment)}, + {"circle-pitch-scale", toUint8(Property::CirclePitchScale)}, + {"circle-radius", toUint8(Property::CircleRadius)}, + {"circle-stroke-color", toUint8(Property::CircleStrokeColor)}, + {"circle-stroke-opacity", toUint8(Property::CircleStrokeOpacity)}, + {"circle-stroke-width", toUint8(Property::CircleStrokeWidth)}, + {"circle-translate", toUint8(Property::CircleTranslate)}, + {"circle-translate-anchor", toUint8(Property::CircleTranslateAnchor)}, + {"circle-blur-transition", toUint8(Property::CircleBlurTransition)}, + {"circle-color-transition", toUint8(Property::CircleColorTransition)}, + {"circle-opacity-transition", toUint8(Property::CircleOpacityTransition)}, + {"circle-pitch-alignment-transition", toUint8(Property::CirclePitchAlignmentTransition)}, + {"circle-pitch-scale-transition", toUint8(Property::CirclePitchScaleTransition)}, + {"circle-radius-transition", toUint8(Property::CircleRadiusTransition)}, + {"circle-stroke-color-transition", toUint8(Property::CircleStrokeColorTransition)}, + {"circle-stroke-opacity-transition", toUint8(Property::CircleStrokeOpacityTransition)}, + {"circle-stroke-width-transition", toUint8(Property::CircleStrokeWidthTransition)}, + {"circle-translate-transition", toUint8(Property::CircleTranslateTransition)}, + {"circle-translate-anchor-transition", toUint8(Property::CircleTranslateAnchorTransition)}}); } // namespace optional<Error> CircleLayer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -533,64 +538,63 @@ optional<Error> CircleLayer::setPaintProperty(const std::string& name, const Con if (!transition) { return error; } - + if (property == Property::CircleBlurTransition) { setCircleBlurTransition(*transition); return nullopt; } - + if (property == Property::CircleColorTransition) { setCircleColorTransition(*transition); return nullopt; } - + if (property == Property::CircleOpacityTransition) { setCircleOpacityTransition(*transition); return nullopt; } - + if (property == Property::CirclePitchAlignmentTransition) { setCirclePitchAlignmentTransition(*transition); return nullopt; } - + if (property == Property::CirclePitchScaleTransition) { setCirclePitchScaleTransition(*transition); return nullopt; } - + if (property == Property::CircleRadiusTransition) { setCircleRadiusTransition(*transition); return nullopt; } - + if (property == Property::CircleStrokeColorTransition) { setCircleStrokeColorTransition(*transition); return nullopt; } - + if (property == Property::CircleStrokeOpacityTransition) { setCircleStrokeOpacityTransition(*transition); return nullopt; } - + if (property == Property::CircleStrokeWidthTransition) { setCircleStrokeWidthTransition(*transition); return nullopt; } - + if (property == Property::CircleTranslateTransition) { setCircleTranslateTransition(*transition); return nullopt; } - + if (property == Property::CircleTranslateAnchorTransition) { setCircleTranslateAnchorTransition(*transition); return nullopt; } - - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } LayerProperty CircleLayer::getPaintProperty(const std::string& name) const { @@ -601,49 +605,49 @@ LayerProperty CircleLayer::getPaintProperty(const std::string& name) const { switch (static_cast<Property>(it->second)) { case Property::CircleBlur: - return conversion::makeLayerProperty(getCircleBlur()); + return makeLayerProperty(getCircleBlur()); case Property::CircleColor: - return conversion::makeLayerProperty(getCircleColor()); + return makeLayerProperty(getCircleColor()); case Property::CircleOpacity: - return conversion::makeLayerProperty(getCircleOpacity()); + return makeLayerProperty(getCircleOpacity()); case Property::CirclePitchAlignment: - return conversion::makeLayerProperty(getCirclePitchAlignment()); + return makeLayerProperty(getCirclePitchAlignment()); case Property::CirclePitchScale: - return conversion::makeLayerProperty(getCirclePitchScale()); + return makeLayerProperty(getCirclePitchScale()); case Property::CircleRadius: - return conversion::makeLayerProperty(getCircleRadius()); + return makeLayerProperty(getCircleRadius()); case Property::CircleStrokeColor: - return conversion::makeLayerProperty(getCircleStrokeColor()); + return makeLayerProperty(getCircleStrokeColor()); case Property::CircleStrokeOpacity: - return conversion::makeLayerProperty(getCircleStrokeOpacity()); + return makeLayerProperty(getCircleStrokeOpacity()); case Property::CircleStrokeWidth: - return conversion::makeLayerProperty(getCircleStrokeWidth()); + return makeLayerProperty(getCircleStrokeWidth()); case Property::CircleTranslate: - return conversion::makeLayerProperty(getCircleTranslate()); + return makeLayerProperty(getCircleTranslate()); case Property::CircleTranslateAnchor: - return conversion::makeLayerProperty(getCircleTranslateAnchor()); + return makeLayerProperty(getCircleTranslateAnchor()); case Property::CircleBlurTransition: - return conversion::makeLayerProperty(getCircleBlurTransition()); + return makeLayerProperty(getCircleBlurTransition()); case Property::CircleColorTransition: - return conversion::makeLayerProperty(getCircleColorTransition()); + return makeLayerProperty(getCircleColorTransition()); case Property::CircleOpacityTransition: - return conversion::makeLayerProperty(getCircleOpacityTransition()); + return makeLayerProperty(getCircleOpacityTransition()); case Property::CirclePitchAlignmentTransition: - return conversion::makeLayerProperty(getCirclePitchAlignmentTransition()); + return makeLayerProperty(getCirclePitchAlignmentTransition()); case Property::CirclePitchScaleTransition: - return conversion::makeLayerProperty(getCirclePitchScaleTransition()); + return makeLayerProperty(getCirclePitchScaleTransition()); case Property::CircleRadiusTransition: - return conversion::makeLayerProperty(getCircleRadiusTransition()); + return makeLayerProperty(getCircleRadiusTransition()); case Property::CircleStrokeColorTransition: - return conversion::makeLayerProperty(getCircleStrokeColorTransition()); + return makeLayerProperty(getCircleStrokeColorTransition()); case Property::CircleStrokeOpacityTransition: - return conversion::makeLayerProperty(getCircleStrokeOpacityTransition()); + return makeLayerProperty(getCircleStrokeOpacityTransition()); case Property::CircleStrokeWidthTransition: - return conversion::makeLayerProperty(getCircleStrokeWidthTransition()); + return makeLayerProperty(getCircleStrokeWidthTransition()); case Property::CircleTranslateTransition: - return conversion::makeLayerProperty(getCircleTranslateTransition()); + return makeLayerProperty(getCircleTranslateTransition()); case Property::CircleTranslateAnchorTransition: - return conversion::makeLayerProperty(getCircleTranslateAnchorTransition()); + return makeLayerProperty(getCircleTranslateAnchorTransition()); } return {}; } diff --git a/src/mbgl/style/layers/fill_extrusion_layer.cpp b/src/mbgl/style/layers/fill_extrusion_layer.cpp index 43183255a1..04206e670d 100644 --- a/src/mbgl/style/layers/fill_extrusion_layer.cpp +++ b/src/mbgl/style/layers/fill_extrusion_layer.cpp @@ -304,30 +304,35 @@ enum class Property { FillExtrusionVerticalGradientTransition, }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {{"fill-extrusion-base", mbgl::underlying_type(Property::FillExtrusionBase)}, - {"fill-extrusion-color", mbgl::underlying_type(Property::FillExtrusionColor)}, - {"fill-extrusion-height", mbgl::underlying_type(Property::FillExtrusionHeight)}, - {"fill-extrusion-opacity", mbgl::underlying_type(Property::FillExtrusionOpacity)}, - {"fill-extrusion-pattern", mbgl::underlying_type(Property::FillExtrusionPattern)}, - {"fill-extrusion-translate", mbgl::underlying_type(Property::FillExtrusionTranslate)}, - {"fill-extrusion-translate-anchor", mbgl::underlying_type(Property::FillExtrusionTranslateAnchor)}, - {"fill-extrusion-vertical-gradient", mbgl::underlying_type(Property::FillExtrusionVerticalGradient)}, - {"fill-extrusion-base-transition", mbgl::underlying_type(Property::FillExtrusionBaseTransition)}, - {"fill-extrusion-color-transition", mbgl::underlying_type(Property::FillExtrusionColorTransition)}, - {"fill-extrusion-height-transition", mbgl::underlying_type(Property::FillExtrusionHeightTransition)}, - {"fill-extrusion-opacity-transition", mbgl::underlying_type(Property::FillExtrusionOpacityTransition)}, - {"fill-extrusion-pattern-transition", mbgl::underlying_type(Property::FillExtrusionPatternTransition)}, - {"fill-extrusion-translate-transition", mbgl::underlying_type(Property::FillExtrusionTranslateTransition)}, - {"fill-extrusion-translate-anchor-transition", mbgl::underlying_type(Property::FillExtrusionTranslateAnchorTransition)}, - {"fill-extrusion-vertical-gradient-transition", mbgl::underlying_type(Property::FillExtrusionVerticalGradientTransition)}}); + {{"fill-extrusion-base", toUint8(Property::FillExtrusionBase)}, + {"fill-extrusion-color", toUint8(Property::FillExtrusionColor)}, + {"fill-extrusion-height", toUint8(Property::FillExtrusionHeight)}, + {"fill-extrusion-opacity", toUint8(Property::FillExtrusionOpacity)}, + {"fill-extrusion-pattern", toUint8(Property::FillExtrusionPattern)}, + {"fill-extrusion-translate", toUint8(Property::FillExtrusionTranslate)}, + {"fill-extrusion-translate-anchor", toUint8(Property::FillExtrusionTranslateAnchor)}, + {"fill-extrusion-vertical-gradient", toUint8(Property::FillExtrusionVerticalGradient)}, + {"fill-extrusion-base-transition", toUint8(Property::FillExtrusionBaseTransition)}, + {"fill-extrusion-color-transition", toUint8(Property::FillExtrusionColorTransition)}, + {"fill-extrusion-height-transition", toUint8(Property::FillExtrusionHeightTransition)}, + {"fill-extrusion-opacity-transition", toUint8(Property::FillExtrusionOpacityTransition)}, + {"fill-extrusion-pattern-transition", toUint8(Property::FillExtrusionPatternTransition)}, + {"fill-extrusion-translate-transition", toUint8(Property::FillExtrusionTranslateTransition)}, + {"fill-extrusion-translate-anchor-transition", toUint8(Property::FillExtrusionTranslateAnchorTransition)}, + {"fill-extrusion-vertical-gradient-transition", toUint8(Property::FillExtrusionVerticalGradientTransition)}}); } // namespace optional<Error> FillExtrusionLayer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -430,49 +435,48 @@ optional<Error> FillExtrusionLayer::setPaintProperty(const std::string& name, co if (!transition) { return error; } - + if (property == Property::FillExtrusionBaseTransition) { setFillExtrusionBaseTransition(*transition); return nullopt; } - + if (property == Property::FillExtrusionColorTransition) { setFillExtrusionColorTransition(*transition); return nullopt; } - + if (property == Property::FillExtrusionHeightTransition) { setFillExtrusionHeightTransition(*transition); return nullopt; } - + if (property == Property::FillExtrusionOpacityTransition) { setFillExtrusionOpacityTransition(*transition); return nullopt; } - + if (property == Property::FillExtrusionPatternTransition) { setFillExtrusionPatternTransition(*transition); return nullopt; } - + if (property == Property::FillExtrusionTranslateTransition) { setFillExtrusionTranslateTransition(*transition); return nullopt; } - + if (property == Property::FillExtrusionTranslateAnchorTransition) { setFillExtrusionTranslateAnchorTransition(*transition); return nullopt; } - + if (property == Property::FillExtrusionVerticalGradientTransition) { setFillExtrusionVerticalGradientTransition(*transition); return nullopt; } - - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } LayerProperty FillExtrusionLayer::getPaintProperty(const std::string& name) const { @@ -483,37 +487,37 @@ LayerProperty FillExtrusionLayer::getPaintProperty(const std::string& name) cons switch (static_cast<Property>(it->second)) { case Property::FillExtrusionBase: - return conversion::makeLayerProperty(getFillExtrusionBase()); + return makeLayerProperty(getFillExtrusionBase()); case Property::FillExtrusionColor: - return conversion::makeLayerProperty(getFillExtrusionColor()); + return makeLayerProperty(getFillExtrusionColor()); case Property::FillExtrusionHeight: - return conversion::makeLayerProperty(getFillExtrusionHeight()); + return makeLayerProperty(getFillExtrusionHeight()); case Property::FillExtrusionOpacity: - return conversion::makeLayerProperty(getFillExtrusionOpacity()); + return makeLayerProperty(getFillExtrusionOpacity()); case Property::FillExtrusionPattern: - return conversion::makeLayerProperty(getFillExtrusionPattern()); + return makeLayerProperty(getFillExtrusionPattern()); case Property::FillExtrusionTranslate: - return conversion::makeLayerProperty(getFillExtrusionTranslate()); + return makeLayerProperty(getFillExtrusionTranslate()); case Property::FillExtrusionTranslateAnchor: - return conversion::makeLayerProperty(getFillExtrusionTranslateAnchor()); + return makeLayerProperty(getFillExtrusionTranslateAnchor()); case Property::FillExtrusionVerticalGradient: - return conversion::makeLayerProperty(getFillExtrusionVerticalGradient()); + return makeLayerProperty(getFillExtrusionVerticalGradient()); case Property::FillExtrusionBaseTransition: - return conversion::makeLayerProperty(getFillExtrusionBaseTransition()); + return makeLayerProperty(getFillExtrusionBaseTransition()); case Property::FillExtrusionColorTransition: - return conversion::makeLayerProperty(getFillExtrusionColorTransition()); + return makeLayerProperty(getFillExtrusionColorTransition()); case Property::FillExtrusionHeightTransition: - return conversion::makeLayerProperty(getFillExtrusionHeightTransition()); + return makeLayerProperty(getFillExtrusionHeightTransition()); case Property::FillExtrusionOpacityTransition: - return conversion::makeLayerProperty(getFillExtrusionOpacityTransition()); + return makeLayerProperty(getFillExtrusionOpacityTransition()); case Property::FillExtrusionPatternTransition: - return conversion::makeLayerProperty(getFillExtrusionPatternTransition()); + return makeLayerProperty(getFillExtrusionPatternTransition()); case Property::FillExtrusionTranslateTransition: - return conversion::makeLayerProperty(getFillExtrusionTranslateTransition()); + return makeLayerProperty(getFillExtrusionTranslateTransition()); case Property::FillExtrusionTranslateAnchorTransition: - return conversion::makeLayerProperty(getFillExtrusionTranslateAnchorTransition()); + return makeLayerProperty(getFillExtrusionTranslateAnchorTransition()); case Property::FillExtrusionVerticalGradientTransition: - return conversion::makeLayerProperty(getFillExtrusionVerticalGradientTransition()); + return makeLayerProperty(getFillExtrusionVerticalGradientTransition()); } return {}; } diff --git a/src/mbgl/style/layers/fill_layer.cpp b/src/mbgl/style/layers/fill_layer.cpp index 9afc99d1d3..25bf97bb6d 100644 --- a/src/mbgl/style/layers/fill_layer.cpp +++ b/src/mbgl/style/layers/fill_layer.cpp @@ -275,28 +275,33 @@ enum class Property { FillTranslateAnchorTransition, }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {{"fill-antialias", mbgl::underlying_type(Property::FillAntialias)}, - {"fill-color", mbgl::underlying_type(Property::FillColor)}, - {"fill-opacity", mbgl::underlying_type(Property::FillOpacity)}, - {"fill-outline-color", mbgl::underlying_type(Property::FillOutlineColor)}, - {"fill-pattern", mbgl::underlying_type(Property::FillPattern)}, - {"fill-translate", mbgl::underlying_type(Property::FillTranslate)}, - {"fill-translate-anchor", mbgl::underlying_type(Property::FillTranslateAnchor)}, - {"fill-antialias-transition", mbgl::underlying_type(Property::FillAntialiasTransition)}, - {"fill-color-transition", mbgl::underlying_type(Property::FillColorTransition)}, - {"fill-opacity-transition", mbgl::underlying_type(Property::FillOpacityTransition)}, - {"fill-outline-color-transition", mbgl::underlying_type(Property::FillOutlineColorTransition)}, - {"fill-pattern-transition", mbgl::underlying_type(Property::FillPatternTransition)}, - {"fill-translate-transition", mbgl::underlying_type(Property::FillTranslateTransition)}, - {"fill-translate-anchor-transition", mbgl::underlying_type(Property::FillTranslateAnchorTransition)}}); + {{"fill-antialias", toUint8(Property::FillAntialias)}, + {"fill-color", toUint8(Property::FillColor)}, + {"fill-opacity", toUint8(Property::FillOpacity)}, + {"fill-outline-color", toUint8(Property::FillOutlineColor)}, + {"fill-pattern", toUint8(Property::FillPattern)}, + {"fill-translate", toUint8(Property::FillTranslate)}, + {"fill-translate-anchor", toUint8(Property::FillTranslateAnchor)}, + {"fill-antialias-transition", toUint8(Property::FillAntialiasTransition)}, + {"fill-color-transition", toUint8(Property::FillColorTransition)}, + {"fill-opacity-transition", toUint8(Property::FillOpacityTransition)}, + {"fill-outline-color-transition", toUint8(Property::FillOutlineColorTransition)}, + {"fill-pattern-transition", toUint8(Property::FillPatternTransition)}, + {"fill-translate-transition", toUint8(Property::FillTranslateTransition)}, + {"fill-translate-anchor-transition", toUint8(Property::FillTranslateAnchorTransition)}}); } // namespace optional<Error> FillLayer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -387,44 +392,43 @@ optional<Error> FillLayer::setPaintProperty(const std::string& name, const Conve if (!transition) { return error; } - + if (property == Property::FillAntialiasTransition) { setFillAntialiasTransition(*transition); return nullopt; } - + if (property == Property::FillColorTransition) { setFillColorTransition(*transition); return nullopt; } - + if (property == Property::FillOpacityTransition) { setFillOpacityTransition(*transition); return nullopt; } - + if (property == Property::FillOutlineColorTransition) { setFillOutlineColorTransition(*transition); return nullopt; } - + if (property == Property::FillPatternTransition) { setFillPatternTransition(*transition); return nullopt; } - + if (property == Property::FillTranslateTransition) { setFillTranslateTransition(*transition); return nullopt; } - + if (property == Property::FillTranslateAnchorTransition) { setFillTranslateAnchorTransition(*transition); return nullopt; } - - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } LayerProperty FillLayer::getPaintProperty(const std::string& name) const { @@ -435,33 +439,33 @@ LayerProperty FillLayer::getPaintProperty(const std::string& name) const { switch (static_cast<Property>(it->second)) { case Property::FillAntialias: - return conversion::makeLayerProperty(getFillAntialias()); + return makeLayerProperty(getFillAntialias()); case Property::FillColor: - return conversion::makeLayerProperty(getFillColor()); + return makeLayerProperty(getFillColor()); case Property::FillOpacity: - return conversion::makeLayerProperty(getFillOpacity()); + return makeLayerProperty(getFillOpacity()); case Property::FillOutlineColor: - return conversion::makeLayerProperty(getFillOutlineColor()); + return makeLayerProperty(getFillOutlineColor()); case Property::FillPattern: - return conversion::makeLayerProperty(getFillPattern()); + return makeLayerProperty(getFillPattern()); case Property::FillTranslate: - return conversion::makeLayerProperty(getFillTranslate()); + return makeLayerProperty(getFillTranslate()); case Property::FillTranslateAnchor: - return conversion::makeLayerProperty(getFillTranslateAnchor()); + return makeLayerProperty(getFillTranslateAnchor()); case Property::FillAntialiasTransition: - return conversion::makeLayerProperty(getFillAntialiasTransition()); + return makeLayerProperty(getFillAntialiasTransition()); case Property::FillColorTransition: - return conversion::makeLayerProperty(getFillColorTransition()); + return makeLayerProperty(getFillColorTransition()); case Property::FillOpacityTransition: - return conversion::makeLayerProperty(getFillOpacityTransition()); + return makeLayerProperty(getFillOpacityTransition()); case Property::FillOutlineColorTransition: - return conversion::makeLayerProperty(getFillOutlineColorTransition()); + return makeLayerProperty(getFillOutlineColorTransition()); case Property::FillPatternTransition: - return conversion::makeLayerProperty(getFillPatternTransition()); + return makeLayerProperty(getFillPatternTransition()); case Property::FillTranslateTransition: - return conversion::makeLayerProperty(getFillTranslateTransition()); + return makeLayerProperty(getFillTranslateTransition()); case Property::FillTranslateAnchorTransition: - return conversion::makeLayerProperty(getFillTranslateAnchorTransition()); + return makeLayerProperty(getFillTranslateAnchorTransition()); } return {}; } diff --git a/src/mbgl/style/layers/heatmap_layer.cpp b/src/mbgl/style/layers/heatmap_layer.cpp index 417e828a1d..3db78c4cf5 100644 --- a/src/mbgl/style/layers/heatmap_layer.cpp +++ b/src/mbgl/style/layers/heatmap_layer.cpp @@ -219,24 +219,29 @@ enum class Property { HeatmapWeightTransition, }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {{"heatmap-color", mbgl::underlying_type(Property::HeatmapColor)}, - {"heatmap-intensity", mbgl::underlying_type(Property::HeatmapIntensity)}, - {"heatmap-opacity", mbgl::underlying_type(Property::HeatmapOpacity)}, - {"heatmap-radius", mbgl::underlying_type(Property::HeatmapRadius)}, - {"heatmap-weight", mbgl::underlying_type(Property::HeatmapWeight)}, - {"heatmap-color-transition", mbgl::underlying_type(Property::HeatmapColorTransition)}, - {"heatmap-intensity-transition", mbgl::underlying_type(Property::HeatmapIntensityTransition)}, - {"heatmap-opacity-transition", mbgl::underlying_type(Property::HeatmapOpacityTransition)}, - {"heatmap-radius-transition", mbgl::underlying_type(Property::HeatmapRadiusTransition)}, - {"heatmap-weight-transition", mbgl::underlying_type(Property::HeatmapWeightTransition)}}); + {{"heatmap-color", toUint8(Property::HeatmapColor)}, + {"heatmap-intensity", toUint8(Property::HeatmapIntensity)}, + {"heatmap-opacity", toUint8(Property::HeatmapOpacity)}, + {"heatmap-radius", toUint8(Property::HeatmapRadius)}, + {"heatmap-weight", toUint8(Property::HeatmapWeight)}, + {"heatmap-color-transition", toUint8(Property::HeatmapColorTransition)}, + {"heatmap-intensity-transition", toUint8(Property::HeatmapIntensityTransition)}, + {"heatmap-opacity-transition", toUint8(Property::HeatmapOpacityTransition)}, + {"heatmap-radius-transition", toUint8(Property::HeatmapRadiusTransition)}, + {"heatmap-weight-transition", toUint8(Property::HeatmapWeightTransition)}}); } // namespace optional<Error> HeatmapLayer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -298,34 +303,33 @@ optional<Error> HeatmapLayer::setPaintProperty(const std::string& name, const Co if (!transition) { return error; } - + if (property == Property::HeatmapColorTransition) { setHeatmapColorTransition(*transition); return nullopt; } - + if (property == Property::HeatmapIntensityTransition) { setHeatmapIntensityTransition(*transition); return nullopt; } - + if (property == Property::HeatmapOpacityTransition) { setHeatmapOpacityTransition(*transition); return nullopt; } - + if (property == Property::HeatmapRadiusTransition) { setHeatmapRadiusTransition(*transition); return nullopt; } - + if (property == Property::HeatmapWeightTransition) { setHeatmapWeightTransition(*transition); return nullopt; } - - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } LayerProperty HeatmapLayer::getPaintProperty(const std::string& name) const { @@ -336,25 +340,25 @@ LayerProperty HeatmapLayer::getPaintProperty(const std::string& name) const { switch (static_cast<Property>(it->second)) { case Property::HeatmapColor: - return conversion::makeLayerProperty(getHeatmapColor()); + return makeLayerProperty(getHeatmapColor()); case Property::HeatmapIntensity: - return conversion::makeLayerProperty(getHeatmapIntensity()); + return makeLayerProperty(getHeatmapIntensity()); case Property::HeatmapOpacity: - return conversion::makeLayerProperty(getHeatmapOpacity()); + return makeLayerProperty(getHeatmapOpacity()); case Property::HeatmapRadius: - return conversion::makeLayerProperty(getHeatmapRadius()); + return makeLayerProperty(getHeatmapRadius()); case Property::HeatmapWeight: - return conversion::makeLayerProperty(getHeatmapWeight()); + return makeLayerProperty(getHeatmapWeight()); case Property::HeatmapColorTransition: - return conversion::makeLayerProperty(getHeatmapColorTransition()); + return makeLayerProperty(getHeatmapColorTransition()); case Property::HeatmapIntensityTransition: - return conversion::makeLayerProperty(getHeatmapIntensityTransition()); + return makeLayerProperty(getHeatmapIntensityTransition()); case Property::HeatmapOpacityTransition: - return conversion::makeLayerProperty(getHeatmapOpacityTransition()); + return makeLayerProperty(getHeatmapOpacityTransition()); case Property::HeatmapRadiusTransition: - return conversion::makeLayerProperty(getHeatmapRadiusTransition()); + return makeLayerProperty(getHeatmapRadiusTransition()); case Property::HeatmapWeightTransition: - return conversion::makeLayerProperty(getHeatmapWeightTransition()); + return makeLayerProperty(getHeatmapWeightTransition()); } return {}; } diff --git a/src/mbgl/style/layers/hillshade_layer.cpp b/src/mbgl/style/layers/hillshade_layer.cpp index 60ef4d33f1..bda125da4a 100644 --- a/src/mbgl/style/layers/hillshade_layer.cpp +++ b/src/mbgl/style/layers/hillshade_layer.cpp @@ -246,26 +246,31 @@ enum class Property { HillshadeShadowColorTransition, }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {{"hillshade-accent-color", mbgl::underlying_type(Property::HillshadeAccentColor)}, - {"hillshade-exaggeration", mbgl::underlying_type(Property::HillshadeExaggeration)}, - {"hillshade-highlight-color", mbgl::underlying_type(Property::HillshadeHighlightColor)}, - {"hillshade-illumination-anchor", mbgl::underlying_type(Property::HillshadeIlluminationAnchor)}, - {"hillshade-illumination-direction", mbgl::underlying_type(Property::HillshadeIlluminationDirection)}, - {"hillshade-shadow-color", mbgl::underlying_type(Property::HillshadeShadowColor)}, - {"hillshade-accent-color-transition", mbgl::underlying_type(Property::HillshadeAccentColorTransition)}, - {"hillshade-exaggeration-transition", mbgl::underlying_type(Property::HillshadeExaggerationTransition)}, - {"hillshade-highlight-color-transition", mbgl::underlying_type(Property::HillshadeHighlightColorTransition)}, - {"hillshade-illumination-anchor-transition", mbgl::underlying_type(Property::HillshadeIlluminationAnchorTransition)}, - {"hillshade-illumination-direction-transition", mbgl::underlying_type(Property::HillshadeIlluminationDirectionTransition)}, - {"hillshade-shadow-color-transition", mbgl::underlying_type(Property::HillshadeShadowColorTransition)}}); + {{"hillshade-accent-color", toUint8(Property::HillshadeAccentColor)}, + {"hillshade-exaggeration", toUint8(Property::HillshadeExaggeration)}, + {"hillshade-highlight-color", toUint8(Property::HillshadeHighlightColor)}, + {"hillshade-illumination-anchor", toUint8(Property::HillshadeIlluminationAnchor)}, + {"hillshade-illumination-direction", toUint8(Property::HillshadeIlluminationDirection)}, + {"hillshade-shadow-color", toUint8(Property::HillshadeShadowColor)}, + {"hillshade-accent-color-transition", toUint8(Property::HillshadeAccentColorTransition)}, + {"hillshade-exaggeration-transition", toUint8(Property::HillshadeExaggerationTransition)}, + {"hillshade-highlight-color-transition", toUint8(Property::HillshadeHighlightColorTransition)}, + {"hillshade-illumination-anchor-transition", toUint8(Property::HillshadeIlluminationAnchorTransition)}, + {"hillshade-illumination-direction-transition", toUint8(Property::HillshadeIlluminationDirectionTransition)}, + {"hillshade-shadow-color-transition", toUint8(Property::HillshadeShadowColorTransition)}}); } // namespace optional<Error> HillshadeLayer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -332,39 +337,38 @@ optional<Error> HillshadeLayer::setPaintProperty(const std::string& name, const if (!transition) { return error; } - + if (property == Property::HillshadeAccentColorTransition) { setHillshadeAccentColorTransition(*transition); return nullopt; } - + if (property == Property::HillshadeExaggerationTransition) { setHillshadeExaggerationTransition(*transition); return nullopt; } - + if (property == Property::HillshadeHighlightColorTransition) { setHillshadeHighlightColorTransition(*transition); return nullopt; } - + if (property == Property::HillshadeIlluminationAnchorTransition) { setHillshadeIlluminationAnchorTransition(*transition); return nullopt; } - + if (property == Property::HillshadeIlluminationDirectionTransition) { setHillshadeIlluminationDirectionTransition(*transition); return nullopt; } - + if (property == Property::HillshadeShadowColorTransition) { setHillshadeShadowColorTransition(*transition); return nullopt; } - - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } LayerProperty HillshadeLayer::getPaintProperty(const std::string& name) const { @@ -375,29 +379,29 @@ LayerProperty HillshadeLayer::getPaintProperty(const std::string& name) const { switch (static_cast<Property>(it->second)) { case Property::HillshadeAccentColor: - return conversion::makeLayerProperty(getHillshadeAccentColor()); + return makeLayerProperty(getHillshadeAccentColor()); case Property::HillshadeExaggeration: - return conversion::makeLayerProperty(getHillshadeExaggeration()); + return makeLayerProperty(getHillshadeExaggeration()); case Property::HillshadeHighlightColor: - return conversion::makeLayerProperty(getHillshadeHighlightColor()); + return makeLayerProperty(getHillshadeHighlightColor()); case Property::HillshadeIlluminationAnchor: - return conversion::makeLayerProperty(getHillshadeIlluminationAnchor()); + return makeLayerProperty(getHillshadeIlluminationAnchor()); case Property::HillshadeIlluminationDirection: - return conversion::makeLayerProperty(getHillshadeIlluminationDirection()); + return makeLayerProperty(getHillshadeIlluminationDirection()); case Property::HillshadeShadowColor: - return conversion::makeLayerProperty(getHillshadeShadowColor()); + return makeLayerProperty(getHillshadeShadowColor()); case Property::HillshadeAccentColorTransition: - return conversion::makeLayerProperty(getHillshadeAccentColorTransition()); + return makeLayerProperty(getHillshadeAccentColorTransition()); case Property::HillshadeExaggerationTransition: - return conversion::makeLayerProperty(getHillshadeExaggerationTransition()); + return makeLayerProperty(getHillshadeExaggerationTransition()); case Property::HillshadeHighlightColorTransition: - return conversion::makeLayerProperty(getHillshadeHighlightColorTransition()); + return makeLayerProperty(getHillshadeHighlightColorTransition()); case Property::HillshadeIlluminationAnchorTransition: - return conversion::makeLayerProperty(getHillshadeIlluminationAnchorTransition()); + return makeLayerProperty(getHillshadeIlluminationAnchorTransition()); case Property::HillshadeIlluminationDirectionTransition: - return conversion::makeLayerProperty(getHillshadeIlluminationDirectionTransition()); + return makeLayerProperty(getHillshadeIlluminationDirectionTransition()); case Property::HillshadeShadowColorTransition: - return conversion::makeLayerProperty(getHillshadeShadowColorTransition()); + return makeLayerProperty(getHillshadeShadowColorTransition()); } return {}; } diff --git a/src/mbgl/style/layers/layer.cpp.ejs b/src/mbgl/style/layers/layer.cpp.ejs index 04d4a81dce..81b04be267 100644 --- a/src/mbgl/style/layers/layer.cpp.ejs +++ b/src/mbgl/style/layers/layer.cpp.ejs @@ -201,16 +201,21 @@ enum class Property { <% } -%> }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {<%- paintProperties.map(p => `{"${p.name}", mbgl::underlying_type(Property::${camelize(p.name)})}`).join(',\n ') %>, - <%- paintProperties.map(p => `{"${p.name}-transition", mbgl::underlying_type(Property::${camelize(p.name)}Transition)}`).join(',\n ') %>}); + {<%- paintProperties.map(p => `{"${p.name}", toUint8(Property::${camelize(p.name)})}`).join(',\n ') %>, + <%- paintProperties.map(p => `{"${p.name}-transition", toUint8(Property::${camelize(p.name)}Transition)}`).join(',\n ') %>}); } // namespace optional<Error> <%- camelize(type) %>Layer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -251,14 +256,13 @@ optional<Error> <%- camelize(type) %>Layer::setPaintProperty(const std::string& if (!transition) { return error; } - <% for (const property of paintProperties) { %> +<% for (const property of paintProperties) { %> if (property == Property::<%- camelize(property.name) %>Transition) { set<%- camelize(property.name) %>Transition(*transition); return nullopt; } - <% } %> - - return Error { "layer doesn't support this property" }; +<% } %> + return Error{"layer doesn't support this property"}; } LayerProperty <%- camelize(type) %>Layer::getPaintProperty(const std::string& name) const { @@ -270,11 +274,11 @@ LayerProperty <%- camelize(type) %>Layer::getPaintProperty(const std::string& na switch (static_cast<Property>(it->second)) { <% for (const property of paintProperties) { -%> case Property::<%- camelize(property.name) %>: - return conversion::makeLayerProperty(get<%- camelize(property.name) %>()); + return makeLayerProperty(get<%- camelize(property.name) %>()); <% } -%> <% for (const property of paintProperties) { -%> case Property::<%- camelize(property.name) %>Transition: - return conversion::makeLayerProperty(get<%- camelize(property.name) %>Transition()); + return makeLayerProperty(get<%- camelize(property.name) %>Transition()); <% } -%> } return {}; diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp index 491cfd48a0..ee1cfe2966 100644 --- a/src/mbgl/style/layers/line_layer.cpp +++ b/src/mbgl/style/layers/line_layer.cpp @@ -457,36 +457,41 @@ enum class Property { LineWidthTransition, }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {{"line-blur", mbgl::underlying_type(Property::LineBlur)}, - {"line-color", mbgl::underlying_type(Property::LineColor)}, - {"line-dasharray", mbgl::underlying_type(Property::LineDasharray)}, - {"line-gap-width", mbgl::underlying_type(Property::LineGapWidth)}, - {"line-gradient", mbgl::underlying_type(Property::LineGradient)}, - {"line-offset", mbgl::underlying_type(Property::LineOffset)}, - {"line-opacity", mbgl::underlying_type(Property::LineOpacity)}, - {"line-pattern", mbgl::underlying_type(Property::LinePattern)}, - {"line-translate", mbgl::underlying_type(Property::LineTranslate)}, - {"line-translate-anchor", mbgl::underlying_type(Property::LineTranslateAnchor)}, - {"line-width", mbgl::underlying_type(Property::LineWidth)}, - {"line-blur-transition", mbgl::underlying_type(Property::LineBlurTransition)}, - {"line-color-transition", mbgl::underlying_type(Property::LineColorTransition)}, - {"line-dasharray-transition", mbgl::underlying_type(Property::LineDasharrayTransition)}, - {"line-gap-width-transition", mbgl::underlying_type(Property::LineGapWidthTransition)}, - {"line-gradient-transition", mbgl::underlying_type(Property::LineGradientTransition)}, - {"line-offset-transition", mbgl::underlying_type(Property::LineOffsetTransition)}, - {"line-opacity-transition", mbgl::underlying_type(Property::LineOpacityTransition)}, - {"line-pattern-transition", mbgl::underlying_type(Property::LinePatternTransition)}, - {"line-translate-transition", mbgl::underlying_type(Property::LineTranslateTransition)}, - {"line-translate-anchor-transition", mbgl::underlying_type(Property::LineTranslateAnchorTransition)}, - {"line-width-transition", mbgl::underlying_type(Property::LineWidthTransition)}}); + {{"line-blur", toUint8(Property::LineBlur)}, + {"line-color", toUint8(Property::LineColor)}, + {"line-dasharray", toUint8(Property::LineDasharray)}, + {"line-gap-width", toUint8(Property::LineGapWidth)}, + {"line-gradient", toUint8(Property::LineGradient)}, + {"line-offset", toUint8(Property::LineOffset)}, + {"line-opacity", toUint8(Property::LineOpacity)}, + {"line-pattern", toUint8(Property::LinePattern)}, + {"line-translate", toUint8(Property::LineTranslate)}, + {"line-translate-anchor", toUint8(Property::LineTranslateAnchor)}, + {"line-width", toUint8(Property::LineWidth)}, + {"line-blur-transition", toUint8(Property::LineBlurTransition)}, + {"line-color-transition", toUint8(Property::LineColorTransition)}, + {"line-dasharray-transition", toUint8(Property::LineDasharrayTransition)}, + {"line-gap-width-transition", toUint8(Property::LineGapWidthTransition)}, + {"line-gradient-transition", toUint8(Property::LineGradientTransition)}, + {"line-offset-transition", toUint8(Property::LineOffsetTransition)}, + {"line-opacity-transition", toUint8(Property::LineOpacityTransition)}, + {"line-pattern-transition", toUint8(Property::LinePatternTransition)}, + {"line-translate-transition", toUint8(Property::LineTranslateTransition)}, + {"line-translate-anchor-transition", toUint8(Property::LineTranslateAnchorTransition)}, + {"line-width-transition", toUint8(Property::LineWidthTransition)}}); } // namespace optional<Error> LineLayer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -604,64 +609,63 @@ optional<Error> LineLayer::setPaintProperty(const std::string& name, const Conve if (!transition) { return error; } - + if (property == Property::LineBlurTransition) { setLineBlurTransition(*transition); return nullopt; } - + if (property == Property::LineColorTransition) { setLineColorTransition(*transition); return nullopt; } - + if (property == Property::LineDasharrayTransition) { setLineDasharrayTransition(*transition); return nullopt; } - + if (property == Property::LineGapWidthTransition) { setLineGapWidthTransition(*transition); return nullopt; } - + if (property == Property::LineGradientTransition) { setLineGradientTransition(*transition); return nullopt; } - + if (property == Property::LineOffsetTransition) { setLineOffsetTransition(*transition); return nullopt; } - + if (property == Property::LineOpacityTransition) { setLineOpacityTransition(*transition); return nullopt; } - + if (property == Property::LinePatternTransition) { setLinePatternTransition(*transition); return nullopt; } - + if (property == Property::LineTranslateTransition) { setLineTranslateTransition(*transition); return nullopt; } - + if (property == Property::LineTranslateAnchorTransition) { setLineTranslateAnchorTransition(*transition); return nullopt; } - + if (property == Property::LineWidthTransition) { setLineWidthTransition(*transition); return nullopt; } - - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } LayerProperty LineLayer::getPaintProperty(const std::string& name) const { @@ -672,49 +676,49 @@ LayerProperty LineLayer::getPaintProperty(const std::string& name) const { switch (static_cast<Property>(it->second)) { case Property::LineBlur: - return conversion::makeLayerProperty(getLineBlur()); + return makeLayerProperty(getLineBlur()); case Property::LineColor: - return conversion::makeLayerProperty(getLineColor()); + return makeLayerProperty(getLineColor()); case Property::LineDasharray: - return conversion::makeLayerProperty(getLineDasharray()); + return makeLayerProperty(getLineDasharray()); case Property::LineGapWidth: - return conversion::makeLayerProperty(getLineGapWidth()); + return makeLayerProperty(getLineGapWidth()); case Property::LineGradient: - return conversion::makeLayerProperty(getLineGradient()); + return makeLayerProperty(getLineGradient()); case Property::LineOffset: - return conversion::makeLayerProperty(getLineOffset()); + return makeLayerProperty(getLineOffset()); case Property::LineOpacity: - return conversion::makeLayerProperty(getLineOpacity()); + return makeLayerProperty(getLineOpacity()); case Property::LinePattern: - return conversion::makeLayerProperty(getLinePattern()); + return makeLayerProperty(getLinePattern()); case Property::LineTranslate: - return conversion::makeLayerProperty(getLineTranslate()); + return makeLayerProperty(getLineTranslate()); case Property::LineTranslateAnchor: - return conversion::makeLayerProperty(getLineTranslateAnchor()); + return makeLayerProperty(getLineTranslateAnchor()); case Property::LineWidth: - return conversion::makeLayerProperty(getLineWidth()); + return makeLayerProperty(getLineWidth()); case Property::LineBlurTransition: - return conversion::makeLayerProperty(getLineBlurTransition()); + return makeLayerProperty(getLineBlurTransition()); case Property::LineColorTransition: - return conversion::makeLayerProperty(getLineColorTransition()); + return makeLayerProperty(getLineColorTransition()); case Property::LineDasharrayTransition: - return conversion::makeLayerProperty(getLineDasharrayTransition()); + return makeLayerProperty(getLineDasharrayTransition()); case Property::LineGapWidthTransition: - return conversion::makeLayerProperty(getLineGapWidthTransition()); + return makeLayerProperty(getLineGapWidthTransition()); case Property::LineGradientTransition: - return conversion::makeLayerProperty(getLineGradientTransition()); + return makeLayerProperty(getLineGradientTransition()); case Property::LineOffsetTransition: - return conversion::makeLayerProperty(getLineOffsetTransition()); + return makeLayerProperty(getLineOffsetTransition()); case Property::LineOpacityTransition: - return conversion::makeLayerProperty(getLineOpacityTransition()); + return makeLayerProperty(getLineOpacityTransition()); case Property::LinePatternTransition: - return conversion::makeLayerProperty(getLinePatternTransition()); + return makeLayerProperty(getLinePatternTransition()); case Property::LineTranslateTransition: - return conversion::makeLayerProperty(getLineTranslateTransition()); + return makeLayerProperty(getLineTranslateTransition()); case Property::LineTranslateAnchorTransition: - return conversion::makeLayerProperty(getLineTranslateAnchorTransition()); + return makeLayerProperty(getLineTranslateAnchorTransition()); case Property::LineWidthTransition: - return conversion::makeLayerProperty(getLineWidthTransition()); + return makeLayerProperty(getLineWidthTransition()); } return {}; } diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp index d10ba0ae8e..263cc0e2f4 100644 --- a/src/mbgl/style/layers/raster_layer.cpp +++ b/src/mbgl/style/layers/raster_layer.cpp @@ -304,30 +304,35 @@ enum class Property { RasterSaturationTransition, }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {{"raster-brightness-max", mbgl::underlying_type(Property::RasterBrightnessMax)}, - {"raster-brightness-min", mbgl::underlying_type(Property::RasterBrightnessMin)}, - {"raster-contrast", mbgl::underlying_type(Property::RasterContrast)}, - {"raster-fade-duration", mbgl::underlying_type(Property::RasterFadeDuration)}, - {"raster-hue-rotate", mbgl::underlying_type(Property::RasterHueRotate)}, - {"raster-opacity", mbgl::underlying_type(Property::RasterOpacity)}, - {"raster-resampling", mbgl::underlying_type(Property::RasterResampling)}, - {"raster-saturation", mbgl::underlying_type(Property::RasterSaturation)}, - {"raster-brightness-max-transition", mbgl::underlying_type(Property::RasterBrightnessMaxTransition)}, - {"raster-brightness-min-transition", mbgl::underlying_type(Property::RasterBrightnessMinTransition)}, - {"raster-contrast-transition", mbgl::underlying_type(Property::RasterContrastTransition)}, - {"raster-fade-duration-transition", mbgl::underlying_type(Property::RasterFadeDurationTransition)}, - {"raster-hue-rotate-transition", mbgl::underlying_type(Property::RasterHueRotateTransition)}, - {"raster-opacity-transition", mbgl::underlying_type(Property::RasterOpacityTransition)}, - {"raster-resampling-transition", mbgl::underlying_type(Property::RasterResamplingTransition)}, - {"raster-saturation-transition", mbgl::underlying_type(Property::RasterSaturationTransition)}}); + {{"raster-brightness-max", toUint8(Property::RasterBrightnessMax)}, + {"raster-brightness-min", toUint8(Property::RasterBrightnessMin)}, + {"raster-contrast", toUint8(Property::RasterContrast)}, + {"raster-fade-duration", toUint8(Property::RasterFadeDuration)}, + {"raster-hue-rotate", toUint8(Property::RasterHueRotate)}, + {"raster-opacity", toUint8(Property::RasterOpacity)}, + {"raster-resampling", toUint8(Property::RasterResampling)}, + {"raster-saturation", toUint8(Property::RasterSaturation)}, + {"raster-brightness-max-transition", toUint8(Property::RasterBrightnessMaxTransition)}, + {"raster-brightness-min-transition", toUint8(Property::RasterBrightnessMinTransition)}, + {"raster-contrast-transition", toUint8(Property::RasterContrastTransition)}, + {"raster-fade-duration-transition", toUint8(Property::RasterFadeDurationTransition)}, + {"raster-hue-rotate-transition", toUint8(Property::RasterHueRotateTransition)}, + {"raster-opacity-transition", toUint8(Property::RasterOpacityTransition)}, + {"raster-resampling-transition", toUint8(Property::RasterResamplingTransition)}, + {"raster-saturation-transition", toUint8(Property::RasterSaturationTransition)}}); } // namespace optional<Error> RasterLayer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -395,49 +400,48 @@ optional<Error> RasterLayer::setPaintProperty(const std::string& name, const Con if (!transition) { return error; } - + if (property == Property::RasterBrightnessMaxTransition) { setRasterBrightnessMaxTransition(*transition); return nullopt; } - + if (property == Property::RasterBrightnessMinTransition) { setRasterBrightnessMinTransition(*transition); return nullopt; } - + if (property == Property::RasterContrastTransition) { setRasterContrastTransition(*transition); return nullopt; } - + if (property == Property::RasterFadeDurationTransition) { setRasterFadeDurationTransition(*transition); return nullopt; } - + if (property == Property::RasterHueRotateTransition) { setRasterHueRotateTransition(*transition); return nullopt; } - + if (property == Property::RasterOpacityTransition) { setRasterOpacityTransition(*transition); return nullopt; } - + if (property == Property::RasterResamplingTransition) { setRasterResamplingTransition(*transition); return nullopt; } - + if (property == Property::RasterSaturationTransition) { setRasterSaturationTransition(*transition); return nullopt; } - - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } LayerProperty RasterLayer::getPaintProperty(const std::string& name) const { @@ -448,37 +452,37 @@ LayerProperty RasterLayer::getPaintProperty(const std::string& name) const { switch (static_cast<Property>(it->second)) { case Property::RasterBrightnessMax: - return conversion::makeLayerProperty(getRasterBrightnessMax()); + return makeLayerProperty(getRasterBrightnessMax()); case Property::RasterBrightnessMin: - return conversion::makeLayerProperty(getRasterBrightnessMin()); + return makeLayerProperty(getRasterBrightnessMin()); case Property::RasterContrast: - return conversion::makeLayerProperty(getRasterContrast()); + return makeLayerProperty(getRasterContrast()); case Property::RasterFadeDuration: - return conversion::makeLayerProperty(getRasterFadeDuration()); + return makeLayerProperty(getRasterFadeDuration()); case Property::RasterHueRotate: - return conversion::makeLayerProperty(getRasterHueRotate()); + return makeLayerProperty(getRasterHueRotate()); case Property::RasterOpacity: - return conversion::makeLayerProperty(getRasterOpacity()); + return makeLayerProperty(getRasterOpacity()); case Property::RasterResampling: - return conversion::makeLayerProperty(getRasterResampling()); + return makeLayerProperty(getRasterResampling()); case Property::RasterSaturation: - return conversion::makeLayerProperty(getRasterSaturation()); + return makeLayerProperty(getRasterSaturation()); case Property::RasterBrightnessMaxTransition: - return conversion::makeLayerProperty(getRasterBrightnessMaxTransition()); + return makeLayerProperty(getRasterBrightnessMaxTransition()); case Property::RasterBrightnessMinTransition: - return conversion::makeLayerProperty(getRasterBrightnessMinTransition()); + return makeLayerProperty(getRasterBrightnessMinTransition()); case Property::RasterContrastTransition: - return conversion::makeLayerProperty(getRasterContrastTransition()); + return makeLayerProperty(getRasterContrastTransition()); case Property::RasterFadeDurationTransition: - return conversion::makeLayerProperty(getRasterFadeDurationTransition()); + return makeLayerProperty(getRasterFadeDurationTransition()); case Property::RasterHueRotateTransition: - return conversion::makeLayerProperty(getRasterHueRotateTransition()); + return makeLayerProperty(getRasterHueRotateTransition()); case Property::RasterOpacityTransition: - return conversion::makeLayerProperty(getRasterOpacityTransition()); + return makeLayerProperty(getRasterOpacityTransition()); case Property::RasterResamplingTransition: - return conversion::makeLayerProperty(getRasterResamplingTransition()); + return makeLayerProperty(getRasterResamplingTransition()); case Property::RasterSaturationTransition: - return conversion::makeLayerProperty(getRasterSaturationTransition()); + return makeLayerProperty(getRasterSaturationTransition()); } return {}; } diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp index b36c02e558..48ecc245c5 100644 --- a/src/mbgl/style/layers/symbol_layer.cpp +++ b/src/mbgl/style/layers/symbol_layer.cpp @@ -1135,42 +1135,47 @@ enum class Property { TextTranslateAnchorTransition, }; +template <typename T> +constexpr uint8_t toUint8(T t) noexcept { + return uint8_t(mbgl::underlying_type(t)); +} + MAPBOX_ETERNAL_CONSTEXPR const auto paintProperties = mapbox::eternal::hash_map<mapbox::eternal::string, uint8_t>( - {{"icon-color", mbgl::underlying_type(Property::IconColor)}, - {"icon-halo-blur", mbgl::underlying_type(Property::IconHaloBlur)}, - {"icon-halo-color", mbgl::underlying_type(Property::IconHaloColor)}, - {"icon-halo-width", mbgl::underlying_type(Property::IconHaloWidth)}, - {"icon-opacity", mbgl::underlying_type(Property::IconOpacity)}, - {"icon-translate", mbgl::underlying_type(Property::IconTranslate)}, - {"icon-translate-anchor", mbgl::underlying_type(Property::IconTranslateAnchor)}, - {"text-color", mbgl::underlying_type(Property::TextColor)}, - {"text-halo-blur", mbgl::underlying_type(Property::TextHaloBlur)}, - {"text-halo-color", mbgl::underlying_type(Property::TextHaloColor)}, - {"text-halo-width", mbgl::underlying_type(Property::TextHaloWidth)}, - {"text-opacity", mbgl::underlying_type(Property::TextOpacity)}, - {"text-translate", mbgl::underlying_type(Property::TextTranslate)}, - {"text-translate-anchor", mbgl::underlying_type(Property::TextTranslateAnchor)}, - {"icon-color-transition", mbgl::underlying_type(Property::IconColorTransition)}, - {"icon-halo-blur-transition", mbgl::underlying_type(Property::IconHaloBlurTransition)}, - {"icon-halo-color-transition", mbgl::underlying_type(Property::IconHaloColorTransition)}, - {"icon-halo-width-transition", mbgl::underlying_type(Property::IconHaloWidthTransition)}, - {"icon-opacity-transition", mbgl::underlying_type(Property::IconOpacityTransition)}, - {"icon-translate-transition", mbgl::underlying_type(Property::IconTranslateTransition)}, - {"icon-translate-anchor-transition", mbgl::underlying_type(Property::IconTranslateAnchorTransition)}, - {"text-color-transition", mbgl::underlying_type(Property::TextColorTransition)}, - {"text-halo-blur-transition", mbgl::underlying_type(Property::TextHaloBlurTransition)}, - {"text-halo-color-transition", mbgl::underlying_type(Property::TextHaloColorTransition)}, - {"text-halo-width-transition", mbgl::underlying_type(Property::TextHaloWidthTransition)}, - {"text-opacity-transition", mbgl::underlying_type(Property::TextOpacityTransition)}, - {"text-translate-transition", mbgl::underlying_type(Property::TextTranslateTransition)}, - {"text-translate-anchor-transition", mbgl::underlying_type(Property::TextTranslateAnchorTransition)}}); + {{"icon-color", toUint8(Property::IconColor)}, + {"icon-halo-blur", toUint8(Property::IconHaloBlur)}, + {"icon-halo-color", toUint8(Property::IconHaloColor)}, + {"icon-halo-width", toUint8(Property::IconHaloWidth)}, + {"icon-opacity", toUint8(Property::IconOpacity)}, + {"icon-translate", toUint8(Property::IconTranslate)}, + {"icon-translate-anchor", toUint8(Property::IconTranslateAnchor)}, + {"text-color", toUint8(Property::TextColor)}, + {"text-halo-blur", toUint8(Property::TextHaloBlur)}, + {"text-halo-color", toUint8(Property::TextHaloColor)}, + {"text-halo-width", toUint8(Property::TextHaloWidth)}, + {"text-opacity", toUint8(Property::TextOpacity)}, + {"text-translate", toUint8(Property::TextTranslate)}, + {"text-translate-anchor", toUint8(Property::TextTranslateAnchor)}, + {"icon-color-transition", toUint8(Property::IconColorTransition)}, + {"icon-halo-blur-transition", toUint8(Property::IconHaloBlurTransition)}, + {"icon-halo-color-transition", toUint8(Property::IconHaloColorTransition)}, + {"icon-halo-width-transition", toUint8(Property::IconHaloWidthTransition)}, + {"icon-opacity-transition", toUint8(Property::IconOpacityTransition)}, + {"icon-translate-transition", toUint8(Property::IconTranslateTransition)}, + {"icon-translate-anchor-transition", toUint8(Property::IconTranslateAnchorTransition)}, + {"text-color-transition", toUint8(Property::TextColorTransition)}, + {"text-halo-blur-transition", toUint8(Property::TextHaloBlurTransition)}, + {"text-halo-color-transition", toUint8(Property::TextHaloColorTransition)}, + {"text-halo-width-transition", toUint8(Property::TextHaloWidthTransition)}, + {"text-opacity-transition", toUint8(Property::TextOpacityTransition)}, + {"text-translate-transition", toUint8(Property::TextTranslateTransition)}, + {"text-translate-anchor-transition", toUint8(Property::TextTranslateAnchorTransition)}}); } // namespace optional<Error> SymbolLayer::setPaintProperty(const std::string& name, const Convertible& value) { const auto it = paintProperties.find(name.c_str()); if (it == paintProperties.end()) { - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } auto property = static_cast<Property>(it->second); @@ -1288,79 +1293,78 @@ optional<Error> SymbolLayer::setPaintProperty(const std::string& name, const Con if (!transition) { return error; } - + if (property == Property::IconColorTransition) { setIconColorTransition(*transition); return nullopt; } - + if (property == Property::IconHaloBlurTransition) { setIconHaloBlurTransition(*transition); return nullopt; } - + if (property == Property::IconHaloColorTransition) { setIconHaloColorTransition(*transition); return nullopt; } - + if (property == Property::IconHaloWidthTransition) { setIconHaloWidthTransition(*transition); return nullopt; } - + if (property == Property::IconOpacityTransition) { setIconOpacityTransition(*transition); return nullopt; } - + if (property == Property::IconTranslateTransition) { setIconTranslateTransition(*transition); return nullopt; } - + if (property == Property::IconTranslateAnchorTransition) { setIconTranslateAnchorTransition(*transition); return nullopt; } - + if (property == Property::TextColorTransition) { setTextColorTransition(*transition); return nullopt; } - + if (property == Property::TextHaloBlurTransition) { setTextHaloBlurTransition(*transition); return nullopt; } - + if (property == Property::TextHaloColorTransition) { setTextHaloColorTransition(*transition); return nullopt; } - + if (property == Property::TextHaloWidthTransition) { setTextHaloWidthTransition(*transition); return nullopt; } - + if (property == Property::TextOpacityTransition) { setTextOpacityTransition(*transition); return nullopt; } - + if (property == Property::TextTranslateTransition) { setTextTranslateTransition(*transition); return nullopt; } - + if (property == Property::TextTranslateAnchorTransition) { setTextTranslateAnchorTransition(*transition); return nullopt; } - - return Error { "layer doesn't support this property" }; + return Error{"layer doesn't support this property"}; } LayerProperty SymbolLayer::getPaintProperty(const std::string& name) const { @@ -1371,61 +1375,61 @@ LayerProperty SymbolLayer::getPaintProperty(const std::string& name) const { switch (static_cast<Property>(it->second)) { case Property::IconColor: - return conversion::makeLayerProperty(getIconColor()); + return makeLayerProperty(getIconColor()); case Property::IconHaloBlur: - return conversion::makeLayerProperty(getIconHaloBlur()); + return makeLayerProperty(getIconHaloBlur()); case Property::IconHaloColor: - return conversion::makeLayerProperty(getIconHaloColor()); + return makeLayerProperty(getIconHaloColor()); case Property::IconHaloWidth: - return conversion::makeLayerProperty(getIconHaloWidth()); + return makeLayerProperty(getIconHaloWidth()); case Property::IconOpacity: - return conversion::makeLayerProperty(getIconOpacity()); + return makeLayerProperty(getIconOpacity()); case Property::IconTranslate: - return conversion::makeLayerProperty(getIconTranslate()); + return makeLayerProperty(getIconTranslate()); case Property::IconTranslateAnchor: - return conversion::makeLayerProperty(getIconTranslateAnchor()); + return makeLayerProperty(getIconTranslateAnchor()); case Property::TextColor: - return conversion::makeLayerProperty(getTextColor()); + return makeLayerProperty(getTextColor()); case Property::TextHaloBlur: - return conversion::makeLayerProperty(getTextHaloBlur()); + return makeLayerProperty(getTextHaloBlur()); case Property::TextHaloColor: - return conversion::makeLayerProperty(getTextHaloColor()); + return makeLayerProperty(getTextHaloColor()); case Property::TextHaloWidth: - return conversion::makeLayerProperty(getTextHaloWidth()); + return makeLayerProperty(getTextHaloWidth()); case Property::TextOpacity: - return conversion::makeLayerProperty(getTextOpacity()); + return makeLayerProperty(getTextOpacity()); case Property::TextTranslate: - return conversion::makeLayerProperty(getTextTranslate()); + return makeLayerProperty(getTextTranslate()); case Property::TextTranslateAnchor: - return conversion::makeLayerProperty(getTextTranslateAnchor()); + return makeLayerProperty(getTextTranslateAnchor()); case Property::IconColorTransition: - return conversion::makeLayerProperty(getIconColorTransition()); + return makeLayerProperty(getIconColorTransition()); case Property::IconHaloBlurTransition: - return conversion::makeLayerProperty(getIconHaloBlurTransition()); + return makeLayerProperty(getIconHaloBlurTransition()); case Property::IconHaloColorTransition: - return conversion::makeLayerProperty(getIconHaloColorTransition()); + return makeLayerProperty(getIconHaloColorTransition()); case Property::IconHaloWidthTransition: - return conversion::makeLayerProperty(getIconHaloWidthTransition()); + return makeLayerProperty(getIconHaloWidthTransition()); case Property::IconOpacityTransition: - return conversion::makeLayerProperty(getIconOpacityTransition()); + return makeLayerProperty(getIconOpacityTransition()); case Property::IconTranslateTransition: - return conversion::makeLayerProperty(getIconTranslateTransition()); + return makeLayerProperty(getIconTranslateTransition()); case Property::IconTranslateAnchorTransition: - return conversion::makeLayerProperty(getIconTranslateAnchorTransition()); + return makeLayerProperty(getIconTranslateAnchorTransition()); case Property::TextColorTransition: - return conversion::makeLayerProperty(getTextColorTransition()); + return makeLayerProperty(getTextColorTransition()); case Property::TextHaloBlurTransition: - return conversion::makeLayerProperty(getTextHaloBlurTransition()); + return makeLayerProperty(getTextHaloBlurTransition()); case Property::TextHaloColorTransition: - return conversion::makeLayerProperty(getTextHaloColorTransition()); + return makeLayerProperty(getTextHaloColorTransition()); case Property::TextHaloWidthTransition: - return conversion::makeLayerProperty(getTextHaloWidthTransition()); + return makeLayerProperty(getTextHaloWidthTransition()); case Property::TextOpacityTransition: - return conversion::makeLayerProperty(getTextOpacityTransition()); + return makeLayerProperty(getTextOpacityTransition()); case Property::TextTranslateTransition: - return conversion::makeLayerProperty(getTextTranslateTransition()); + return makeLayerProperty(getTextTranslateTransition()); case Property::TextTranslateAnchorTransition: - return conversion::makeLayerProperty(getTextTranslateAnchorTransition()); + return makeLayerProperty(getTextTranslateAnchorTransition()); } return {}; } |