diff options
Diffstat (limited to 'src/mbgl/style')
-rw-r--r-- | src/mbgl/style/layers/background_layer_properties.cpp | 1 | ||||
-rw-r--r-- | src/mbgl/style/layers/background_layer_properties.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/layers/circle_layer_impl.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/layers/circle_layer_properties.cpp | 1 | ||||
-rw-r--r-- | src/mbgl/style/layers/circle_layer_properties.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/layers/fill_layer_impl.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/layers/fill_layer_properties.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/style/layers/layer_properties.hpp.ejs | 2 | ||||
-rw-r--r-- | src/mbgl/style/layers/line_layer_impl.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/layers/line_layer_properties.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/layers/symbol_layer_impl.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/style/layers/symbol_layer_properties.hpp | 8 | ||||
-rw-r--r-- | src/mbgl/style/property_evaluator.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/property_parsing.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/style/style.cpp | 8 |
15 files changed, 22 insertions, 24 deletions
diff --git a/src/mbgl/style/layers/background_layer_properties.cpp b/src/mbgl/style/layers/background_layer_properties.cpp index f4c9b952b0..a20cedf12c 100644 --- a/src/mbgl/style/layers/background_layer_properties.cpp +++ b/src/mbgl/style/layers/background_layer_properties.cpp @@ -1,7 +1,6 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. #include <mbgl/style/layers/background_layer_properties.hpp> -#include <utility> namespace mbgl { namespace style { diff --git a/src/mbgl/style/layers/background_layer_properties.hpp b/src/mbgl/style/layers/background_layer_properties.hpp index a1a1a3a5a7..60e4b22684 100644 --- a/src/mbgl/style/layers/background_layer_properties.hpp +++ b/src/mbgl/style/layers/background_layer_properties.hpp @@ -18,7 +18,7 @@ public: void cascade(const CascadeParameters&); bool recalculate(const CalculationParameters&); - PaintProperty<Color> backgroundColor { {{ 0, 0, 0, 1 }} }; + PaintProperty<Color> backgroundColor { { 0, 0, 0, 1 } }; PaintProperty<std::string, CrossFadedPropertyEvaluator> backgroundPattern { "" }; PaintProperty<float> backgroundOpacity { 1 }; }; diff --git a/src/mbgl/style/layers/circle_layer_impl.cpp b/src/mbgl/style/layers/circle_layer_impl.cpp index c2efac5cef..d64759e743 100644 --- a/src/mbgl/style/layers/circle_layer_impl.cpp +++ b/src/mbgl/style/layers/circle_layer_impl.cpp @@ -19,7 +19,7 @@ void CircleLayer::Impl::cascade(const CascadeParameters& parameters) { bool CircleLayer::Impl::recalculate(const CalculationParameters& parameters) { bool hasTransitions = paint.recalculate(parameters); - passes = (paint.circleRadius > 0 && paint.circleColor.value[3] > 0 && paint.circleOpacity > 0) + passes = (paint.circleRadius > 0 && paint.circleColor.value.a > 0 && paint.circleOpacity > 0) ? RenderPass::Translucent : RenderPass::None; return hasTransitions; diff --git a/src/mbgl/style/layers/circle_layer_properties.cpp b/src/mbgl/style/layers/circle_layer_properties.cpp index fed6d5cddc..b21df1e2d0 100644 --- a/src/mbgl/style/layers/circle_layer_properties.cpp +++ b/src/mbgl/style/layers/circle_layer_properties.cpp @@ -1,7 +1,6 @@ // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. #include <mbgl/style/layers/circle_layer_properties.hpp> -#include <utility> namespace mbgl { namespace style { diff --git a/src/mbgl/style/layers/circle_layer_properties.hpp b/src/mbgl/style/layers/circle_layer_properties.hpp index 956e423c45..35c0f1ad51 100644 --- a/src/mbgl/style/layers/circle_layer_properties.hpp +++ b/src/mbgl/style/layers/circle_layer_properties.hpp @@ -19,7 +19,7 @@ public: bool recalculate(const CalculationParameters&); PaintProperty<float> circleRadius { 5 }; - PaintProperty<Color> circleColor { {{ 0, 0, 0, 1 }} }; + PaintProperty<Color> circleColor { { 0, 0, 0, 1 } }; PaintProperty<float> circleBlur { 0 }; PaintProperty<float> circleOpacity { 1 }; PaintProperty<std::array<float, 2>> circleTranslate { {{ 0, 0 }} }; diff --git a/src/mbgl/style/layers/fill_layer_impl.cpp b/src/mbgl/style/layers/fill_layer_impl.cpp index c183617482..3d847127c9 100644 --- a/src/mbgl/style/layers/fill_layer_impl.cpp +++ b/src/mbgl/style/layers/fill_layer_impl.cpp @@ -25,7 +25,7 @@ bool FillLayer::Impl::recalculate(const CalculationParameters& parameters) { passes |= RenderPass::Translucent; } - if (!paint.fillPattern.value.from.empty() || (paint.fillColor.value[3] * paint.fillOpacity) < 1.0f) { + if (!paint.fillPattern.value.from.empty() || (paint.fillColor.value.a * paint.fillOpacity) < 1.0f) { passes |= RenderPass::Translucent; } else { passes |= RenderPass::Opaque; diff --git a/src/mbgl/style/layers/fill_layer_properties.hpp b/src/mbgl/style/layers/fill_layer_properties.hpp index 43396f45d2..09aa432d23 100644 --- a/src/mbgl/style/layers/fill_layer_properties.hpp +++ b/src/mbgl/style/layers/fill_layer_properties.hpp @@ -20,8 +20,8 @@ public: PaintProperty<bool> fillAntialias { true }; PaintProperty<float> fillOpacity { 1 }; - PaintProperty<Color> fillColor { {{ 0, 0, 0, 1 }} }; - PaintProperty<Color> fillOutlineColor { {{ 0, 0, 0, -1 }} }; + PaintProperty<Color> fillColor { { 0, 0, 0, 1 } }; + PaintProperty<Color> fillOutlineColor { { 0, 0, 0, -1 } }; PaintProperty<std::array<float, 2>> fillTranslate { {{ 0, 0 }} }; PaintProperty<TranslateAnchorType> fillTranslateAnchor { TranslateAnchorType::Map }; PaintProperty<std::string, CrossFadedPropertyEvaluator> fillPattern { "" }; diff --git a/src/mbgl/style/layers/layer_properties.hpp.ejs b/src/mbgl/style/layers/layer_properties.hpp.ejs index 55e07ad61b..8ea713e20a 100644 --- a/src/mbgl/style/layers/layer_properties.hpp.ejs +++ b/src/mbgl/style/layers/layer_properties.hpp.ejs @@ -39,7 +39,7 @@ public: <% if (/-pattern$/.test(property.name) || property.name === 'line-dasharray') { -%> PaintProperty<<%- propertyType(property) %>, CrossFadedPropertyEvaluator> <%- camelizeWithLeadingLowercase(property.name) %> { <%- defaultValue(property) %> }; <% } else if (property.name === 'fill-outline-color') { -%> - PaintProperty<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %> { {{ 0, 0, 0, -1 }} }; + PaintProperty<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %> { { 0, 0, 0, -1 } }; <% } else { -%> PaintProperty<<%- propertyType(property) %>> <%- camelizeWithLeadingLowercase(property.name) %> { <%- defaultValue(property) %> }; <% } -%> diff --git a/src/mbgl/style/layers/line_layer_impl.cpp b/src/mbgl/style/layers/line_layer_impl.cpp index b7ee9dc5bf..589b129ee6 100644 --- a/src/mbgl/style/layers/line_layer_impl.cpp +++ b/src/mbgl/style/layers/line_layer_impl.cpp @@ -29,7 +29,7 @@ bool LineLayer::Impl::recalculate(const CalculationParameters& parameters) { bool hasTransitions = paint.recalculate(parameters); - passes = (paint.lineOpacity > 0 && paint.lineColor.value[3] > 0 && paint.lineWidth > 0) + passes = (paint.lineOpacity > 0 && paint.lineColor.value.a > 0 && paint.lineWidth > 0) ? RenderPass::Translucent : RenderPass::None; return hasTransitions; diff --git a/src/mbgl/style/layers/line_layer_properties.hpp b/src/mbgl/style/layers/line_layer_properties.hpp index 01a8534222..c715171c88 100644 --- a/src/mbgl/style/layers/line_layer_properties.hpp +++ b/src/mbgl/style/layers/line_layer_properties.hpp @@ -30,7 +30,7 @@ public: bool recalculate(const CalculationParameters&); PaintProperty<float> lineOpacity { 1 }; - PaintProperty<Color> lineColor { {{ 0, 0, 0, 1 }} }; + PaintProperty<Color> lineColor { { 0, 0, 0, 1 } }; PaintProperty<std::array<float, 2>> lineTranslate { {{ 0, 0 }} }; PaintProperty<TranslateAnchorType> lineTranslateAnchor { TranslateAnchorType::Map }; PaintProperty<float> lineWidth { 1 }; diff --git a/src/mbgl/style/layers/symbol_layer_impl.cpp b/src/mbgl/style/layers/symbol_layer_impl.cpp index 34438285c5..eeceb52078 100644 --- a/src/mbgl/style/layers/symbol_layer_impl.cpp +++ b/src/mbgl/style/layers/symbol_layer_impl.cpp @@ -26,8 +26,8 @@ bool SymbolLayer::Impl::recalculate(const CalculationParameters& parameters) { iconSize = layout.iconSize; textSize = layout.textSize; - passes = ((paint.iconOpacity > 0 && (paint.iconColor.value[3] > 0 || paint.iconHaloColor.value[3] > 0) && iconSize > 0) - || (paint.textOpacity > 0 && (paint.textColor.value[3] > 0 || paint.textHaloColor.value[3] > 0) && textSize > 0)) + passes = ((paint.iconOpacity > 0 && (paint.iconColor.value.a > 0 || paint.iconHaloColor.value.a > 0) && iconSize > 0) + || (paint.textOpacity > 0 && (paint.textColor.value.a > 0 || paint.textHaloColor.value.a > 0) && textSize > 0)) ? RenderPass::Translucent : RenderPass::None; return hasTransitions; diff --git a/src/mbgl/style/layers/symbol_layer_properties.hpp b/src/mbgl/style/layers/symbol_layer_properties.hpp index e938a09c56..772445f051 100644 --- a/src/mbgl/style/layers/symbol_layer_properties.hpp +++ b/src/mbgl/style/layers/symbol_layer_properties.hpp @@ -58,15 +58,15 @@ public: bool recalculate(const CalculationParameters&); PaintProperty<float> iconOpacity { 1 }; - PaintProperty<Color> iconColor { {{ 0, 0, 0, 1 }} }; - PaintProperty<Color> iconHaloColor { {{ 0, 0, 0, 0 }} }; + PaintProperty<Color> iconColor { { 0, 0, 0, 1 } }; + PaintProperty<Color> iconHaloColor { { 0, 0, 0, 0 } }; PaintProperty<float> iconHaloWidth { 0 }; PaintProperty<float> iconHaloBlur { 0 }; PaintProperty<std::array<float, 2>> iconTranslate { {{ 0, 0 }} }; PaintProperty<TranslateAnchorType> iconTranslateAnchor { TranslateAnchorType::Map }; PaintProperty<float> textOpacity { 1 }; - PaintProperty<Color> textColor { {{ 0, 0, 0, 1 }} }; - PaintProperty<Color> textHaloColor { {{ 0, 0, 0, 0 }} }; + PaintProperty<Color> textColor { { 0, 0, 0, 1 } }; + PaintProperty<Color> textHaloColor { { 0, 0, 0, 0 } }; PaintProperty<float> textHaloWidth { 0 }; PaintProperty<float> textHaloBlur { 0 }; PaintProperty<std::array<float, 2>> textTranslate { {{ 0, 0 }} }; diff --git a/src/mbgl/style/property_evaluator.cpp b/src/mbgl/style/property_evaluator.cpp index 3993456b6d..7b91b9e500 100644 --- a/src/mbgl/style/property_evaluator.cpp +++ b/src/mbgl/style/property_evaluator.cpp @@ -15,7 +15,7 @@ inline T defaultStopsValue(); template <> inline bool defaultStopsValue() { return true; } template <> inline float defaultStopsValue() { return 1.0f; } -template <> inline Color defaultStopsValue() { return {{ 0, 0, 0, 1 }}; } +template <> inline Color defaultStopsValue() { return { 0, 0, 0, 1 }; } template <> inline std::vector<float> defaultStopsValue() { return {{ 1, 0 }}; } template <> inline std::vector<std::string> defaultStopsValue() { return {{}}; } template <> inline std::array<float, 2> defaultStopsValue() { return {{ 0, 0 }}; } diff --git a/src/mbgl/style/property_parsing.cpp b/src/mbgl/style/property_parsing.cpp index 9985cc7f39..f5e0cca993 100644 --- a/src/mbgl/style/property_parsing.cpp +++ b/src/mbgl/style/property_parsing.cpp @@ -49,10 +49,10 @@ optional<Color> parseConstant(const char* name, const JSValue& value) { // Premultiply the color. const float factor = css_color.a / 255; - return Color{{(float)css_color.r * factor, + return Color{ (float)css_color.r * factor, (float)css_color.g * factor, (float)css_color.b * factor, - css_color.a}}; + css_color.a }; } template <> diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 5dd00bd309..44192fc985 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -267,10 +267,10 @@ RenderData Style::getRenderData() const { if (layer.get() == layers[0].get() && paint.backgroundPattern.value.from.empty()) { // This is a solid background. We can use glClear(). result.backgroundColor = paint.backgroundColor; - result.backgroundColor[0] *= paint.backgroundOpacity; - result.backgroundColor[1] *= paint.backgroundOpacity; - result.backgroundColor[2] *= paint.backgroundOpacity; - result.backgroundColor[3] *= paint.backgroundOpacity; + result.backgroundColor.r *= paint.backgroundOpacity; + result.backgroundColor.g *= paint.backgroundOpacity; + result.backgroundColor.b *= paint.backgroundOpacity; + result.backgroundColor.a *= paint.backgroundOpacity; } else { // This is a textured background, or not the bottommost layer. We need to render it with a quad. result.order.emplace_back(*layer); |