summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-06-04 15:28:23 +0200
committerMolly Lloyd <molly@mapbox.com>2018-08-27 13:13:47 -0700
commitf44d0dedc276a6ddc807eadc11d3f172e55ae21a (patch)
treee9c2f888983ee86ed5a5e6dee2882884d4a8741a
parent4cd22869d79c142a24a22a3763ddba46fda98673 (diff)
downloadqtlocation-mapboxgl-f44d0dedc276a6ddc807eadc11d3f172e55ae21a.tar.gz
[core] move PaintProperty::Attribute to TypeList and pass to Binder constructors
-rw-r--r--src/mbgl/renderer/paint_property_binder.hpp19
-rw-r--r--src/mbgl/style/paint_property.hpp1
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;
};