diff options
author | Young Hahn <young@mapbox.com> | 2016-06-15 11:38:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-15 11:38:22 -0400 |
commit | 24b66bc8cdd40a52e08d198c063daa3e1f6be92a (patch) | |
tree | 6d98a5e1216a83f7d6d4c78422c8306d4a4cb157 /src/mbgl/style/layers | |
parent | fe64238b4cd5a7da403a4f29a62b14234ecba569 (diff) | |
download | qtlocation-mapboxgl-24b66bc8cdd40a52e08d198c063daa3e1f6be92a.tar.gz |
Color class (#5361)
* Color class
* Switch to list initialization
Diffstat (limited to 'src/mbgl/style/layers')
-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 |
12 files changed, 15 insertions, 17 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 }} }; |