diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-06-04 15:28:23 +0200 |
---|---|---|
committer | Molly Lloyd <mollymerp@users.noreply.github.com> | 2018-08-31 13:08:47 -0700 |
commit | ec62e321531b1a836074056e86de8e20018280fb (patch) | |
tree | ad9df0486cec4f2fe441563dd28a396217da2689 /src | |
parent | 5e9bbfdd44ef9c0a2c5850566c28a40aa2a05151 (diff) | |
download | qtlocation-mapboxgl-ec62e321531b1a836074056e86de8e20018280fb.tar.gz |
[core] move PaintProperty::Attribute to TypeList and pass to Binder constructors
Diffstat (limited to 'src')
-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 cf0a71847e..29eb716785 100644 --- a/src/mbgl/renderer/paint_property_binder.hpp +++ b/src/mbgl/renderer/paint_property_binder.hpp @@ -269,9 +269,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...>, @@ -299,9 +312,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 3d9d7710dc..1afc1e5734 100644 --- a/src/mbgl/style/paint_property.hpp +++ b/src/mbgl/style/paint_property.hpp @@ -34,6 +34,7 @@ public: static constexpr bool IsDataDriven = true; using Attribute = A; + using Attributes = TypeList<A>; using Uniform = U; }; |