[core] cascade ⇢ transition / cascading ⇢ transitionable
This commit is contained in:
@@ -160,7 +160,6 @@ set(MBGL_CORE_FILES
|
||||
src/mbgl/renderer/bucket.hpp
|
||||
src/mbgl/renderer/bucket_parameters.cpp
|
||||
src/mbgl/renderer/bucket_parameters.hpp
|
||||
src/mbgl/renderer/cascade_parameters.hpp
|
||||
src/mbgl/renderer/cross_faded_property_evaluator.cpp
|
||||
src/mbgl/renderer/cross_faded_property_evaluator.hpp
|
||||
src/mbgl/renderer/data_driven_property_evaluator.hpp
|
||||
@@ -192,6 +191,7 @@ set(MBGL_CORE_FILES
|
||||
src/mbgl/renderer/tile_parameters.hpp
|
||||
src/mbgl/renderer/tile_pyramid.cpp
|
||||
src/mbgl/renderer/tile_pyramid.hpp
|
||||
src/mbgl/renderer/transition_parameters.hpp
|
||||
src/mbgl/renderer/update_parameters.hpp
|
||||
|
||||
# renderer/buckets
|
||||
|
||||
@@ -18,8 +18,8 @@ std::unique_ptr<Bucket> RenderBackgroundLayer::createBucket(const BucketParamete
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void RenderBackgroundLayer::cascade(const CascadeParameters ¶meters) {
|
||||
unevaluated = impl().paint.cascade(parameters, std::move(unevaluated));
|
||||
void RenderBackgroundLayer::transition(const TransitionParameters ¶meters) {
|
||||
unevaluated = impl().paint.transition(parameters, std::move(unevaluated));
|
||||
}
|
||||
|
||||
void RenderBackgroundLayer::evaluate(const PropertyEvaluationParameters ¶meters) {
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
RenderBackgroundLayer(Immutable<style::BackgroundLayer::Impl>);
|
||||
~RenderBackgroundLayer() final = default;
|
||||
|
||||
void cascade(const CascadeParameters&) override;
|
||||
void transition(const TransitionParameters&) override;
|
||||
void evaluate(const PropertyEvaluationParameters&) override;
|
||||
bool hasTransition() const override;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ std::unique_ptr<Bucket> RenderCircleLayer::createBucket(const BucketParameters&
|
||||
return std::make_unique<CircleBucket>(parameters, layers);
|
||||
}
|
||||
|
||||
void RenderCircleLayer::cascade(const CascadeParameters& parameters) {
|
||||
unevaluated = impl().paint.cascade(parameters, std::move(unevaluated));
|
||||
void RenderCircleLayer::transition(const TransitionParameters& parameters) {
|
||||
unevaluated = impl().paint.transition(parameters, std::move(unevaluated));
|
||||
}
|
||||
|
||||
void RenderCircleLayer::evaluate(const PropertyEvaluationParameters& parameters) {
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
RenderCircleLayer(Immutable<style::CircleLayer::Impl>);
|
||||
~RenderCircleLayer() final = default;
|
||||
|
||||
void cascade(const CascadeParameters&) override;
|
||||
void transition(const TransitionParameters&) override;
|
||||
void evaluate(const PropertyEvaluationParameters&) override;
|
||||
bool hasTransition() const override;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ public:
|
||||
RenderCustomLayer(Immutable<style::CustomLayer::Impl>);
|
||||
~RenderCustomLayer() final = default;
|
||||
|
||||
void cascade(const CascadeParameters&) final {}
|
||||
void transition(const TransitionParameters&) final {}
|
||||
void evaluate(const PropertyEvaluationParameters&) override;
|
||||
bool hasTransition() const override;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ std::unique_ptr<Bucket> RenderFillExtrusionLayer::createBucket(const BucketParam
|
||||
return std::make_unique<FillExtrusionBucket>(parameters, layers);
|
||||
}
|
||||
|
||||
void RenderFillExtrusionLayer::cascade(const CascadeParameters& parameters) {
|
||||
unevaluated = impl().paint.cascade(parameters, std::move(unevaluated));
|
||||
void RenderFillExtrusionLayer::transition(const TransitionParameters& parameters) {
|
||||
unevaluated = impl().paint.transition(parameters, std::move(unevaluated));
|
||||
}
|
||||
|
||||
void RenderFillExtrusionLayer::evaluate(const PropertyEvaluationParameters& parameters) {
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
RenderFillExtrusionLayer(Immutable<style::FillExtrusionLayer::Impl>);
|
||||
~RenderFillExtrusionLayer() final = default;
|
||||
|
||||
void cascade(const CascadeParameters&) override;
|
||||
void transition(const TransitionParameters&) override;
|
||||
void evaluate(const PropertyEvaluationParameters&) override;
|
||||
bool hasTransition() const override;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ std::unique_ptr<Bucket> RenderFillLayer::createBucket(const BucketParameters& pa
|
||||
return std::make_unique<FillBucket>(parameters, layers);
|
||||
}
|
||||
|
||||
void RenderFillLayer::cascade(const CascadeParameters& parameters) {
|
||||
unevaluated = impl().paint.cascade(parameters, std::move(unevaluated));
|
||||
void RenderFillLayer::transition(const TransitionParameters& parameters) {
|
||||
unevaluated = impl().paint.transition(parameters, std::move(unevaluated));
|
||||
}
|
||||
|
||||
void RenderFillLayer::evaluate(const PropertyEvaluationParameters& parameters) {
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
RenderFillLayer(Immutable<style::FillLayer::Impl>);
|
||||
~RenderFillLayer() final = default;
|
||||
|
||||
void cascade(const CascadeParameters&) override;
|
||||
void transition(const TransitionParameters&) override;
|
||||
void evaluate(const PropertyEvaluationParameters&) override;
|
||||
bool hasTransition() const override;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ std::unique_ptr<Bucket> RenderLineLayer::createBucket(const BucketParameters& pa
|
||||
return std::make_unique<LineBucket>(parameters, layers, impl().layout);
|
||||
}
|
||||
|
||||
void RenderLineLayer::cascade(const CascadeParameters& parameters) {
|
||||
unevaluated = impl().paint.cascade(parameters, std::move(unevaluated));
|
||||
void RenderLineLayer::transition(const TransitionParameters& parameters) {
|
||||
unevaluated = impl().paint.transition(parameters, std::move(unevaluated));
|
||||
}
|
||||
|
||||
void RenderLineLayer::evaluate(const PropertyEvaluationParameters& parameters) {
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
RenderLineLayer(Immutable<style::LineLayer::Impl>);
|
||||
~RenderLineLayer() final = default;
|
||||
|
||||
void cascade(const CascadeParameters&) override;
|
||||
void transition(const TransitionParameters&) override;
|
||||
void evaluate(const PropertyEvaluationParameters&) override;
|
||||
bool hasTransition() const override;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ std::unique_ptr<Bucket> RenderRasterLayer::createBucket(const BucketParameters&,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void RenderRasterLayer::cascade(const CascadeParameters& parameters) {
|
||||
unevaluated = impl().paint.cascade(parameters, std::move(unevaluated));
|
||||
void RenderRasterLayer::transition(const TransitionParameters& parameters) {
|
||||
unevaluated = impl().paint.transition(parameters, std::move(unevaluated));
|
||||
}
|
||||
|
||||
void RenderRasterLayer::evaluate(const PropertyEvaluationParameters& parameters) {
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
RenderRasterLayer(Immutable<style::RasterLayer::Impl>);
|
||||
~RenderRasterLayer() final = default;
|
||||
|
||||
void cascade(const CascadeParameters&) override;
|
||||
void transition(const TransitionParameters&) override;
|
||||
void evaluate(const PropertyEvaluationParameters&) override;
|
||||
bool hasTransition() const override;
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ std::unique_ptr<SymbolLayout> RenderSymbolLayer::createLayout(const BucketParame
|
||||
glyphDependencies);
|
||||
}
|
||||
|
||||
void RenderSymbolLayer::cascade(const CascadeParameters& parameters) {
|
||||
unevaluated = impl().paint.cascade(parameters, std::move(unevaluated));
|
||||
void RenderSymbolLayer::transition(const TransitionParameters& parameters) {
|
||||
unevaluated = impl().paint.transition(parameters, std::move(unevaluated));
|
||||
}
|
||||
|
||||
void RenderSymbolLayer::evaluate(const PropertyEvaluationParameters& parameters) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
RenderSymbolLayer(Immutable<style::SymbolLayer::Impl>);
|
||||
~RenderSymbolLayer() final = default;
|
||||
|
||||
void cascade(const CascadeParameters&) override;
|
||||
void transition(const TransitionParameters&) override;
|
||||
void evaluate(const PropertyEvaluationParameters&) override;
|
||||
bool hasTransition() const override;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace mbgl {
|
||||
|
||||
class Bucket;
|
||||
class BucketParameters;
|
||||
class CascadeParameters;
|
||||
class TransitionParameters;
|
||||
class PropertyEvaluationParameters;
|
||||
|
||||
class RenderLayer {
|
||||
@@ -26,10 +26,10 @@ public:
|
||||
|
||||
virtual ~RenderLayer() = default;
|
||||
|
||||
// Partially evaluate paint properties based on a set of classes.
|
||||
virtual void cascade(const CascadeParameters&) = 0;
|
||||
// Begin transitions for any properties that have changed since the last frame.
|
||||
virtual void transition(const TransitionParameters&) = 0;
|
||||
|
||||
// Fully evaluate cascaded paint properties based on a zoom level.
|
||||
// Fully evaluate possibly-transitioning paint properties based on a zoom level.
|
||||
virtual void evaluate(const PropertyEvaluationParameters&) = 0;
|
||||
|
||||
// Returns true if any paint properties have active transitions.
|
||||
|
||||
@@ -6,8 +6,8 @@ RenderLight::RenderLight(Immutable<style::Light::Impl> impl_)
|
||||
: impl(std::move(impl_)) {
|
||||
}
|
||||
|
||||
void RenderLight::transition(const CascadeParameters& parameters) {
|
||||
transitioning = impl->properties.cascade(parameters, std::move(transitioning));
|
||||
void RenderLight::transition(const TransitionParameters& parameters) {
|
||||
transitioning = impl->properties.transition(parameters, std::move(transitioning));
|
||||
}
|
||||
|
||||
void RenderLight::evaluate(const PropertyEvaluationParameters& parameters) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class CascadeParameters;
|
||||
class TransitionParameters;
|
||||
class PropertyEvaluationParameters;
|
||||
|
||||
using TransitioningLight = style::LightProperties::Unevaluated;
|
||||
@@ -15,7 +15,7 @@ class RenderLight {
|
||||
public:
|
||||
RenderLight(Immutable<style::Light::Impl>);
|
||||
|
||||
void transition(const CascadeParameters&);
|
||||
void transition(const TransitionParameters&);
|
||||
void evaluate(const PropertyEvaluationParameters&);
|
||||
bool hasTransition() const;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class CascadeParameters {
|
||||
class TransitionParameters {
|
||||
public:
|
||||
std::vector<style::ClassID> classes;
|
||||
TimePoint now;
|
||||
@@ -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_));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
|
||||
void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override;
|
||||
|
||||
BackgroundPaintProperties::Cascading paint;
|
||||
BackgroundPaintProperties::Transitionable paint;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
@@ -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_));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
|
||||
void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override;
|
||||
|
||||
CirclePaintProperties::Cascading paint;
|
||||
CirclePaintProperties::Transitionable paint;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
@@ -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_));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
|
||||
void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override;
|
||||
|
||||
FillExtrusionPaintProperties::Cascading paint;
|
||||
FillExtrusionPaintProperties::Transitionable paint;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
@@ -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_));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
|
||||
void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override;
|
||||
|
||||
FillPaintProperties::Cascading paint;
|
||||
FillPaintProperties::Transitionable paint;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
@@ -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_));
|
||||
}
|
||||
|
||||
|
||||
@@ -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_));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override;
|
||||
|
||||
LineLayoutProperties::Unevaluated layout;
|
||||
LinePaintProperties::Cascading paint;
|
||||
LinePaintProperties::Transitionable paint;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
@@ -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_));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
|
||||
void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override;
|
||||
|
||||
RasterPaintProperties::Cascading paint;
|
||||
RasterPaintProperties::Transitionable paint;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
@@ -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_));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override;
|
||||
|
||||
SymbolLayoutProperties::Unevaluated layout;
|
||||
SymbolPaintProperties::Cascading paint;
|
||||
SymbolPaintProperties::Transitionable paint;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
<% } -%>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -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>()))...
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -248,7 +248,7 @@ static std::vector<std::unique_ptr<RenderLayer>> toRenderLayers(const std::vecto
|
||||
for (auto& layer : layers) {
|
||||
renderLayers.push_back(RenderLayer::create(layer));
|
||||
|
||||
renderLayers.back()->cascade(CascadeParameters {
|
||||
renderLayers.back()->transition(TransitionParameters {
|
||||
{ ClassID::Default },
|
||||
Clock::time_point::max(),
|
||||
TransitionOptions()
|
||||
|
||||
Reference in New Issue
Block a user