diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-06-04 15:28:23 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-06-04 15:28:53 +0200 |
commit | f5b452bf5635f2e5cab3c7ea7bd99044a7bcde7e (patch) | |
tree | 11cb07d81b88f22b5ce645779cb697dbaa59a023 | |
parent | 2fd8e5659fa74949b07cb9830485c205af582a17 (diff) | |
download | qtlocation-mapboxgl-upstream/gl-bindings.tar.gz |
[core] move PaintProperty::Attribute to TypeList and pass to Binder constructorsupstream/gl-bindings
-rw-r--r-- | src/mbgl/renderer/paint_property_binder.hpp | 19 | ||||
-rw-r--r-- | src/mbgl/style/paint_property.hpp | 1 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/mbgl/renderer/paint_property_binder.hpp b/src/mbgl/renderer/paint_property_binder.hpp index 378a3b170b..37bd30fb82 100644 --- a/src/mbgl/renderer/paint_property_binder.hpp +++ b/src/mbgl/renderer/paint_property_binder.hpp @@ -268,9 +268,22 @@ class PaintPropertyBinders; template <class... Ps> class PaintPropertyBinders<TypeList<Ps...>> { +private: + template <class T, class... As> + struct Detail; + + template <class T, class... As> + struct Detail<T, TypeList<As...>> { + using Binder = PaintPropertyBinder<T, typename As::Type...>; + using ZoomInterpolatedAttributeList = TypeList<ZoomInterpolatedAttribute<As>...>; + }; + + template <class P> + using Property = Detail<typename P::Type, typename P::Attributes>; + public: template <class P> - using Binder = PaintPropertyBinder<typename P::Type, typename P::Attribute::Type>; + using Binder = typename Property<P>::Binder; using Binders = IndexedTuple< TypeList<Ps...>, @@ -298,9 +311,9 @@ public: } template <class P> - using Attribute = ZoomInterpolatedAttribute<typename P::Attribute>; + using ZoomInterpolatedAttributeList = typename Property<P>::ZoomInterpolatedAttributeList; - using Attributes = gl::Attributes<Attribute<Ps>...>; + using Attributes = typename TypeListConcat<ZoomInterpolatedAttributeList<Ps>...>::template ExpandInto<gl::Attributes>; using AttributeBindings = typename Attributes::Bindings; template <class EvaluatedProperties> diff --git a/src/mbgl/style/paint_property.hpp b/src/mbgl/style/paint_property.hpp index 195eb645a9..37fbb7ff09 100644 --- a/src/mbgl/style/paint_property.hpp +++ b/src/mbgl/style/paint_property.hpp @@ -35,6 +35,7 @@ public: static constexpr bool IsDataDriven = true; using Attribute = A; + using Attributes = TypeList<A>; using Uniform = U; }; |