diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-10 12:20:15 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-15 09:45:55 -0700 |
commit | e473f2dcceb31eda816ac9e6c972d7e0a8f1dceb (patch) | |
tree | a80415390c30f4e4efd47da25f6fee776730465d /src/mbgl/style | |
parent | da4d735e2c465195e0fb9531ce9d4d7c5c9e6503 (diff) | |
download | qtlocation-mapboxgl-e473f2dcceb31eda816ac9e6c972d7e0a8f1dceb.tar.gz |
[core] cascade ⇢ transition / cascading ⇢ transitionable
Diffstat (limited to 'src/mbgl/style')
22 files changed, 53 insertions, 52 deletions
diff --git a/src/mbgl/style/layers/background_layer.cpp b/src/mbgl/style/layers/background_layer.cpp index 1c5b6c3a66..6c9be96528 100644 --- a/src/mbgl/style/layers/background_layer.cpp +++ b/src/mbgl/style/layers/background_layer.cpp @@ -28,7 +28,7 @@ Mutable<BackgroundLayer::Impl> BackgroundLayer::mutableImpl() const { std::unique_ptr<Layer> BackgroundLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; - impl_->paint = BackgroundPaintProperties::Cascading(); + impl_->paint = BackgroundPaintProperties::Transitionable(); return std::make_unique<BackgroundLayer>(std::move(impl_)); } diff --git a/src/mbgl/style/layers/background_layer_impl.hpp b/src/mbgl/style/layers/background_layer_impl.hpp index b50fccf00b..4f14662658 100644 --- a/src/mbgl/style/layers/background_layer_impl.hpp +++ b/src/mbgl/style/layers/background_layer_impl.hpp @@ -13,7 +13,7 @@ public: void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; - BackgroundPaintProperties::Cascading paint; + BackgroundPaintProperties::Transitionable paint; }; } // namespace style diff --git a/src/mbgl/style/layers/circle_layer.cpp b/src/mbgl/style/layers/circle_layer.cpp index e874f00ff7..1f64aa7ca6 100644 --- a/src/mbgl/style/layers/circle_layer.cpp +++ b/src/mbgl/style/layers/circle_layer.cpp @@ -28,7 +28,7 @@ Mutable<CircleLayer::Impl> CircleLayer::mutableImpl() const { std::unique_ptr<Layer> CircleLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; - impl_->paint = CirclePaintProperties::Cascading(); + impl_->paint = CirclePaintProperties::Transitionable(); return std::make_unique<CircleLayer>(std::move(impl_)); } diff --git a/src/mbgl/style/layers/circle_layer_impl.hpp b/src/mbgl/style/layers/circle_layer_impl.hpp index 0263ace62f..79ef879ab9 100644 --- a/src/mbgl/style/layers/circle_layer_impl.hpp +++ b/src/mbgl/style/layers/circle_layer_impl.hpp @@ -13,7 +13,7 @@ public: void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; - CirclePaintProperties::Cascading paint; + CirclePaintProperties::Transitionable paint; }; } // namespace style diff --git a/src/mbgl/style/layers/fill_extrusion_layer.cpp b/src/mbgl/style/layers/fill_extrusion_layer.cpp index cff0c59df2..37ae79850b 100644 --- a/src/mbgl/style/layers/fill_extrusion_layer.cpp +++ b/src/mbgl/style/layers/fill_extrusion_layer.cpp @@ -28,7 +28,7 @@ Mutable<FillExtrusionLayer::Impl> FillExtrusionLayer::mutableImpl() const { std::unique_ptr<Layer> FillExtrusionLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; - impl_->paint = FillExtrusionPaintProperties::Cascading(); + impl_->paint = FillExtrusionPaintProperties::Transitionable(); return std::make_unique<FillExtrusionLayer>(std::move(impl_)); } diff --git a/src/mbgl/style/layers/fill_extrusion_layer_impl.hpp b/src/mbgl/style/layers/fill_extrusion_layer_impl.hpp index 4eadf56eda..73c65469d1 100644 --- a/src/mbgl/style/layers/fill_extrusion_layer_impl.hpp +++ b/src/mbgl/style/layers/fill_extrusion_layer_impl.hpp @@ -13,7 +13,7 @@ public: void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; - FillExtrusionPaintProperties::Cascading paint; + FillExtrusionPaintProperties::Transitionable paint; }; } // namespace style diff --git a/src/mbgl/style/layers/fill_layer.cpp b/src/mbgl/style/layers/fill_layer.cpp index d38b027740..5e3df1d54d 100644 --- a/src/mbgl/style/layers/fill_layer.cpp +++ b/src/mbgl/style/layers/fill_layer.cpp @@ -28,7 +28,7 @@ Mutable<FillLayer::Impl> FillLayer::mutableImpl() const { std::unique_ptr<Layer> FillLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; - impl_->paint = FillPaintProperties::Cascading(); + impl_->paint = FillPaintProperties::Transitionable(); return std::make_unique<FillLayer>(std::move(impl_)); } diff --git a/src/mbgl/style/layers/fill_layer_impl.hpp b/src/mbgl/style/layers/fill_layer_impl.hpp index 1d64fe8fa4..72ea8ab352 100644 --- a/src/mbgl/style/layers/fill_layer_impl.hpp +++ b/src/mbgl/style/layers/fill_layer_impl.hpp @@ -13,7 +13,7 @@ public: void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; - FillPaintProperties::Cascading paint; + FillPaintProperties::Transitionable paint; }; } // namespace style diff --git a/src/mbgl/style/layers/layer.cpp.ejs b/src/mbgl/style/layers/layer.cpp.ejs index 738165e668..4f747792cf 100644 --- a/src/mbgl/style/layers/layer.cpp.ejs +++ b/src/mbgl/style/layers/layer.cpp.ejs @@ -39,7 +39,7 @@ Mutable<<%- camelize(type) %>Layer::Impl> <%- camelize(type) %>Layer::mutableImp std::unique_ptr<Layer> <%- camelize(type) %>Layer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; - impl_->paint = <%- camelize(type) %>PaintProperties::Cascading(); + impl_->paint = <%- camelize(type) %>PaintProperties::Transitionable(); return std::make_unique<<%- camelize(type) %>Layer>(std::move(impl_)); } diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp index c8684ec6f5..286289b28e 100644 --- a/src/mbgl/style/layers/line_layer.cpp +++ b/src/mbgl/style/layers/line_layer.cpp @@ -28,7 +28,7 @@ Mutable<LineLayer::Impl> LineLayer::mutableImpl() const { std::unique_ptr<Layer> LineLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; - impl_->paint = LinePaintProperties::Cascading(); + impl_->paint = LinePaintProperties::Transitionable(); return std::make_unique<LineLayer>(std::move(impl_)); } diff --git a/src/mbgl/style/layers/line_layer_impl.hpp b/src/mbgl/style/layers/line_layer_impl.hpp index 2eab19a612..333821dc17 100644 --- a/src/mbgl/style/layers/line_layer_impl.hpp +++ b/src/mbgl/style/layers/line_layer_impl.hpp @@ -14,7 +14,7 @@ public: void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; LineLayoutProperties::Unevaluated layout; - LinePaintProperties::Cascading paint; + LinePaintProperties::Transitionable paint; }; } // namespace style diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp index a17e34dd8a..fc28672abd 100644 --- a/src/mbgl/style/layers/raster_layer.cpp +++ b/src/mbgl/style/layers/raster_layer.cpp @@ -28,7 +28,7 @@ Mutable<RasterLayer::Impl> RasterLayer::mutableImpl() const { std::unique_ptr<Layer> RasterLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; - impl_->paint = RasterPaintProperties::Cascading(); + impl_->paint = RasterPaintProperties::Transitionable(); return std::make_unique<RasterLayer>(std::move(impl_)); } diff --git a/src/mbgl/style/layers/raster_layer_impl.hpp b/src/mbgl/style/layers/raster_layer_impl.hpp index 13e5b3f4cf..2178fd69d4 100644 --- a/src/mbgl/style/layers/raster_layer_impl.hpp +++ b/src/mbgl/style/layers/raster_layer_impl.hpp @@ -13,7 +13,7 @@ public: void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; - RasterPaintProperties::Cascading paint; + RasterPaintProperties::Transitionable paint; }; } // namespace style diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp index 4a3ad2ffcc..d21014dda0 100644 --- a/src/mbgl/style/layers/symbol_layer.cpp +++ b/src/mbgl/style/layers/symbol_layer.cpp @@ -28,7 +28,7 @@ Mutable<SymbolLayer::Impl> SymbolLayer::mutableImpl() const { std::unique_ptr<Layer> SymbolLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; - impl_->paint = SymbolPaintProperties::Cascading(); + impl_->paint = SymbolPaintProperties::Transitionable(); return std::make_unique<SymbolLayer>(std::move(impl_)); } diff --git a/src/mbgl/style/layers/symbol_layer_impl.hpp b/src/mbgl/style/layers/symbol_layer_impl.hpp index 28760e1f74..7b9415436d 100644 --- a/src/mbgl/style/layers/symbol_layer_impl.hpp +++ b/src/mbgl/style/layers/symbol_layer_impl.hpp @@ -14,7 +14,7 @@ public: void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; SymbolLayoutProperties::Unevaluated layout; - SymbolPaintProperties::Cascading paint; + SymbolPaintProperties::Transitionable paint; }; } // namespace style diff --git a/src/mbgl/style/layout_property.hpp b/src/mbgl/style/layout_property.hpp index 82a19e6a80..8c59295ad2 100644 --- a/src/mbgl/style/layout_property.hpp +++ b/src/mbgl/style/layout_property.hpp @@ -11,7 +11,7 @@ namespace style { template <class T> class LayoutProperty { public: - using CascadingType = std::nullptr_t; + using TransitionableType = std::nullptr_t; using UnevaluatedType = PropertyValue<T>; using EvaluatorType = PropertyEvaluator<T>; using PossiblyEvaluatedType = T; @@ -22,7 +22,7 @@ public: template <class T> class DataDrivenLayoutProperty { public: - using CascadingType = std::nullptr_t; + using TransitionableType = std::nullptr_t; using UnevaluatedType = DataDrivenPropertyValue<T>; using EvaluatorType = DataDrivenPropertyEvaluator<T>; using PossiblyEvaluatedType = PossiblyEvaluatedPropertyValue<T>; diff --git a/src/mbgl/style/light.cpp b/src/mbgl/style/light.cpp index 651a323da4..352dc4d942 100644 --- a/src/mbgl/style/light.cpp +++ b/src/mbgl/style/light.cpp @@ -39,15 +39,15 @@ void Light::setAnchor(PropertyValue<LightAnchorType> property) { observer->onLightChanged(*this); } -void Light::setAnchorTransition(const TransitionOptions& transition) { +void Light::setAnchorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); - impl_->properties.template get<LightAnchor>().transition = transition; + impl_->properties.template get<LightAnchor>().options = options; impl = std::move(impl_); observer->onLightChanged(*this); } TransitionOptions Light::getAnchorTransition() const { - return impl->properties.template get<LightAnchor>().transition; + return impl->properties.template get<LightAnchor>().options; } Position Light::getDefaultPosition() { @@ -65,15 +65,15 @@ void Light::setPosition(PropertyValue<Position> property) { observer->onLightChanged(*this); } -void Light::setPositionTransition(const TransitionOptions& transition) { +void Light::setPositionTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); - impl_->properties.template get<LightPosition>().transition = transition; + impl_->properties.template get<LightPosition>().options = options; impl = std::move(impl_); observer->onLightChanged(*this); } TransitionOptions Light::getPositionTransition() const { - return impl->properties.template get<LightPosition>().transition; + return impl->properties.template get<LightPosition>().options; } Color Light::getDefaultColor() { @@ -91,15 +91,15 @@ void Light::setColor(PropertyValue<Color> property) { observer->onLightChanged(*this); } -void Light::setColorTransition(const TransitionOptions& transition) { +void Light::setColorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); - impl_->properties.template get<LightColor>().transition = transition; + impl_->properties.template get<LightColor>().options = options; impl = std::move(impl_); observer->onLightChanged(*this); } TransitionOptions Light::getColorTransition() const { - return impl->properties.template get<LightColor>().transition; + return impl->properties.template get<LightColor>().options; } float Light::getDefaultIntensity() { @@ -117,15 +117,15 @@ void Light::setIntensity(PropertyValue<float> property) { observer->onLightChanged(*this); } -void Light::setIntensityTransition(const TransitionOptions& transition) { +void Light::setIntensityTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); - impl_->properties.template get<LightIntensity>().transition = transition; + impl_->properties.template get<LightIntensity>().options = options; impl = std::move(impl_); observer->onLightChanged(*this); } TransitionOptions Light::getIntensityTransition() const { - return impl->properties.template get<LightIntensity>().transition; + return impl->properties.template get<LightIntensity>().options; } diff --git a/src/mbgl/style/light.cpp.ejs b/src/mbgl/style/light.cpp.ejs index e933e40b97..45241c60fd 100644 --- a/src/mbgl/style/light.cpp.ejs +++ b/src/mbgl/style/light.cpp.ejs @@ -43,15 +43,15 @@ void Light::set<%- camelize(property.name) %>(<%- propertyValueType(property) %> observer->onLightChanged(*this); } -void Light::set<%- camelize(property.name) %>Transition(const TransitionOptions& transition) { +void Light::set<%- camelize(property.name) %>Transition(const TransitionOptions& options) { auto impl_ = mutableImpl(); - impl_->properties.template get<Light<%- camelize(property.name) %>>().transition = transition; + impl_->properties.template get<Light<%- camelize(property.name) %>>().options = options; impl = std::move(impl_); observer->onLightChanged(*this); } TransitionOptions Light::get<%- camelize(property.name) %>Transition() const { - return impl->properties.template get<Light<%- camelize(property.name) %>>().transition; + return impl->properties.template get<Light<%- camelize(property.name) %>>().options; } <% } -%> diff --git a/src/mbgl/style/light_impl.hpp b/src/mbgl/style/light_impl.hpp index 7cf160f439..f094c9d462 100644 --- a/src/mbgl/style/light_impl.hpp +++ b/src/mbgl/style/light_impl.hpp @@ -15,7 +15,7 @@ namespace style { template <class T> class LightProperty { public: - using CascadingType = Transitionable<PropertyValue<T>>; + using TransitionableType = Transitionable<PropertyValue<T>>; using UnevaluatedType = Transitioning<PropertyValue<T>>; using EvaluatorType = PropertyEvaluator<T>; using PossiblyEvaluatedType = T; @@ -52,7 +52,7 @@ using LightProperties = Properties<LightAnchor, LightPosition, LightColor, Light class Light::Impl { public: - LightProperties::Cascading properties; + LightProperties::Transitionable properties; }; } // namespace style diff --git a/src/mbgl/style/paint_property.hpp b/src/mbgl/style/paint_property.hpp index b0dc5641fb..80d54abceb 100644 --- a/src/mbgl/style/paint_property.hpp +++ b/src/mbgl/style/paint_property.hpp @@ -15,7 +15,7 @@ namespace style { template <class T> class PaintProperty { public: - using CascadingType = Cascading<PropertyValue<T>>; + using TransitionableType = Cascading<PropertyValue<T>>; using UnevaluatedType = Transitioning<PropertyValue<T>>; using EvaluatorType = PropertyEvaluator<T>; using PossiblyEvaluatedType = T; @@ -26,7 +26,7 @@ public: template <class T, class A> class DataDrivenPaintProperty { public: - using CascadingType = Cascading<DataDrivenPropertyValue<T>>; + using TransitionableType = Cascading<DataDrivenPropertyValue<T>>; using UnevaluatedType = Transitioning<DataDrivenPropertyValue<T>>; using EvaluatorType = DataDrivenPropertyEvaluator<T>; using PossiblyEvaluatedType = PossiblyEvaluatedPropertyValue<T>; @@ -39,7 +39,7 @@ public: template <class T> class CrossFadedPaintProperty { public: - using CascadingType = Cascading<PropertyValue<T>>; + using TransitionableType = Cascading<PropertyValue<T>>; using UnevaluatedType = Transitioning<PropertyValue<T>>; using EvaluatorType = CrossFadedPropertyEvaluator<T>; using PossiblyEvaluatedType = Faded<T>; diff --git a/src/mbgl/style/properties.hpp b/src/mbgl/style/properties.hpp index c808554c93..cd69ffb9be 100644 --- a/src/mbgl/style/properties.hpp +++ b/src/mbgl/style/properties.hpp @@ -2,10 +2,10 @@ #include <mbgl/style/transition_options.hpp> #include <mbgl/style/conversion/stringify.hpp> -#include <mbgl/renderer/cascade_parameters.hpp> +#include <mbgl/renderer/transition_parameters.hpp> #include <mbgl/renderer/paint_property_binder.hpp> #include <mbgl/renderer/property_evaluation_parameters.hpp> -#include <mbgl/renderer/cascade_parameters.hpp> +#include <mbgl/renderer/transition_parameters.hpp> #include <mbgl/util/indexed_tuple.hpp> #include <mbgl/util/ignore.hpp> @@ -82,15 +82,16 @@ template <class Value> class Transitionable { public: Value value; - TransitionOptions transition; + TransitionOptions options; - Transitioning<Value> cascade(const CascadeParameters& params, Transitioning<Value> prior) const { + Transitioning<Value> transition(const TransitionParameters& params, Transitioning<Value> prior) const { return Transitioning<Value>(value, std::move(prior), - transition.reverseMerge(params.transition), + options.reverseMerge(params.transition), params.now); } }; + template <class Value> class Cascading { public: @@ -118,7 +119,7 @@ public: transitions[klass ? ClassDictionary::Get().lookup(*klass) : ClassID::Default] = transition; } - Transitioning<Value> cascade(const CascadeParameters& params, Transitioning<Value> prior) const { + Transitioning<Value> transition(const TransitionParameters& params, Transitioning<Value> prior) const { TransitionOptions transition; Value value; @@ -168,7 +169,7 @@ public: */ using PropertyTypes = TypeList<Ps...>; - using CascadingTypes = TypeList<typename Ps::CascadingType...>; + using TransitionableTypes = TypeList<typename Ps::TransitionableType...>; using UnevaluatedTypes = TypeList<typename Ps::UnevaluatedType...>; using PossiblyEvaluatedTypes = TypeList<typename Ps::PossiblyEvaluatedType...>; using EvaluatedTypes = TypeList<typename Ps::Type...>; @@ -251,14 +252,14 @@ public: } }; - class Cascading : public Tuple<CascadingTypes> { + class Transitionable : public Tuple<TransitionableTypes> { public: - using Tuple<CascadingTypes>::Tuple; + using Tuple<TransitionableTypes>::Tuple; - Unevaluated cascade(const CascadeParameters& parameters, Unevaluated&& prior) const { + Unevaluated transition(const TransitionParameters& parameters, Unevaluated&& prior) const { return Unevaluated { this->template get<Ps>() - .cascade(parameters, std::move(prior.template get<Ps>()))... + .transition(parameters, std::move(prior.template get<Ps>()))... }; } }; diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 7a76d289cf..962ba0f39b 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -22,7 +22,7 @@ #include <mbgl/text/glyph_atlas.hpp> #include <mbgl/geometry/line_atlas.hpp> #include <mbgl/renderer/update_parameters.hpp> -#include <mbgl/renderer/cascade_parameters.hpp> +#include <mbgl/renderer/transition_parameters.hpp> #include <mbgl/renderer/property_evaluation_parameters.hpp> #include <mbgl/renderer/tile_parameters.hpp> #include <mbgl/renderer/render_source.hpp> @@ -341,7 +341,7 @@ void Style::update(const UpdateParameters& parameters) { } classIDs.push_back(ClassID::Default); - const CascadeParameters cascadeParameters { + const TransitionParameters transitionParameters { classIDs, parameters.timePoint, parameters.mode == MapMode::Continuous ? transitionOptions : TransitionOptions() @@ -367,7 +367,7 @@ void Style::update(const UpdateParameters& parameters) { if (lightChanged) { renderLight.impl = light->impl; - renderLight.transition(cascadeParameters); + renderLight.transition(transitionParameters); } if (lightChanged || zoomChanged || renderLight.hasTransition()) { @@ -433,7 +433,7 @@ void Style::update(const UpdateParameters& parameters) { const bool layerChanged = layerDiff.changed.count(entry.first); if (classesChanged || layerAdded || layerChanged) { - layer.cascade(cascadeParameters); + layer.transition(transitionParameters); } if (classesChanged || layerAdded || layerChanged || zoomChanged || layer.hasTransition()) { |