diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-10 11:34:00 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-15 09:45:55 -0700 |
commit | da4d735e2c465195e0fb9531ce9d4d7c5c9e6503 (patch) | |
tree | d7145d5f884420703d0a1bb03a0492eebf05b160 /src/mbgl/renderer/render_light.hpp | |
parent | 2690a65f8dc9e920c16af3264864321295f7daa8 (diff) | |
download | qtlocation-mapboxgl-da4d735e2c465195e0fb9531ce9d4d7c5c9e6503.tar.gz |
[core] Unify {Paint,Layout,Light}Properties
Diffstat (limited to 'src/mbgl/renderer/render_light.hpp')
-rw-r--r-- | src/mbgl/renderer/render_light.hpp | 70 |
1 files changed, 5 insertions, 65 deletions
diff --git a/src/mbgl/renderer/render_light.hpp b/src/mbgl/renderer/render_light.hpp index 7e0662105f..ce83616bbe 100644 --- a/src/mbgl/renderer/render_light.hpp +++ b/src/mbgl/renderer/render_light.hpp @@ -1,75 +1,15 @@ #pragma once #include <mbgl/style/light_impl.hpp> -#include <mbgl/renderer/transitioning_property.hpp> -#include <mbgl/renderer/cascade_parameters.hpp> -#include <mbgl/renderer/property_evaluator.hpp> -#include <mbgl/renderer/property_evaluation_parameters.hpp> -#include <mbgl/util/ignore.hpp> - -#include <memory> +#include <mbgl/util/immutable.hpp> namespace mbgl { -template <class TypeList> -class Transitioning; - -template <class... Ps> -class Transitioning<TypeList<Ps...>> : public IndexedTuple< - TypeList<Ps...>, - TypeList<TransitioningProperty<typename Ps::ValueType>...>> -{ -private: - using Properties = TypeList<Ps...>; - using Raw = IndexedTuple<Properties, Properties>; - using Super = IndexedTuple< - TypeList<Ps...>, - TypeList<TransitioningProperty<typename Ps::ValueType>...>>; - -public: - Transitioning() = default; - Transitioning(const Raw& raw, Transitioning&& prior, const CascadeParameters& params) - : Super { - TransitioningProperty<typename Ps::ValueType>( - raw.template get<Ps>().value, - std::move(prior.template get<Ps>()), - raw.template get<Ps>().transition.reverseMerge(params.transition), - params.now)... - } {} - - bool hasTransition() const { - bool result = false; - util::ignore({ result |= this->template get<Ps>().hasTransition()... }); - return result; - } -}; - -template <class TypeList> -class Evaluated; - -template <class... Ps> -class Evaluated<TypeList<Ps...>> : public IndexedTuple< - TypeList<Ps...>, - TypeList<typename Ps::Type...>> -{ -private: - using Properties = TypeList<Ps...>; - using TransitioningPs = Transitioning<Properties>; - using Super = IndexedTuple< - TypeList<Ps...>, - TypeList<typename Ps::Type...>>; - -public: - Evaluated() = default; - Evaluated(TransitioningPs& transitioning, const PropertyEvaluationParameters& params) - : Super { - transitioning.template get<Ps>() - .evaluate(PropertyEvaluator<typename Ps::Type>(params, Ps::defaultValue()), params.now)... - } {} -}; +class CascadeParameters; +class PropertyEvaluationParameters; -using TransitioningLight = Transitioning<style::LightProperties>; -using EvaluatedLight = Evaluated<style::LightProperties>; +using TransitioningLight = style::LightProperties::Unevaluated; +using EvaluatedLight = style::LightProperties::PossiblyEvaluated; class RenderLight { public: |