aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-05-31 18:42:13 +0200
committerKonstantin Käfer <mail@kkaefer.com>2018-06-04 15:28:53 +0200
commit16b3f79e05e46f9e73344108f30fbce2e225e376 (patch)
tree45ec7a9daeed26a250e8adf6275e4ffa72cf3834
parentb802cc141caa950f56fe928e5ca57aa3a80d93bd (diff)
[core] allow passing multiple AttributeTypes to a PaintPropertyBinder
-rw-r--r--src/mbgl/renderer/paint_property_binder.hpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mbgl/renderer/paint_property_binder.hpp b/src/mbgl/renderer/paint_property_binder.hpp
index 506ea8eda..378a3b170 100644
--- a/src/mbgl/renderer/paint_property_binder.hpp
+++ b/src/mbgl/renderer/paint_property_binder.hpp
@@ -72,7 +72,7 @@ std::array<float, N*2> zoomInterpolatedAttributeValue(const std::array<float, N>
Note that the shader source varies depending on whether we're using a uniform or
attribute. Like GL JS, we dynamically compile shaders at runtime to accomodate this.
*/
-template <class T, class A>
+template <class T, class... As>
class PaintPropertyBinder {
public:
@@ -233,18 +233,18 @@ private:
optional<gl::VertexBuffer<Vertex>> vertexBuffer;
};
-template <class T, class A>
-std::unique_ptr<PaintPropertyBinder<T, A>>
-PaintPropertyBinder<T, A>::create(const PossiblyEvaluatedPropertyValue<T>& value, float zoom, T defaultValue) {
+template <class T, class... As>
+std::unique_ptr<PaintPropertyBinder<T, As...>>
+PaintPropertyBinder<T, As...>::create(const PossiblyEvaluatedPropertyValue<T>& value, float zoom, T defaultValue) {
return value.match(
- [&] (const T& constant) -> std::unique_ptr<PaintPropertyBinder<T, A>> {
- return std::make_unique<ConstantPaintPropertyBinder<T, A>>(constant);
+ [&] (const T& constant) -> std::unique_ptr<PaintPropertyBinder<T, As...>> {
+ return std::make_unique<ConstantPaintPropertyBinder<T, As...>>(constant);
},
[&] (const style::SourceFunction<T>& function) {
- return std::make_unique<SourceFunctionPaintPropertyBinder<T, A>>(function, defaultValue);
+ return std::make_unique<SourceFunctionPaintPropertyBinder<T, As...>>(function, defaultValue);
},
[&] (const style::CompositeFunction<T>& function) {
- return std::make_unique<CompositeFunctionPaintPropertyBinder<T, A>>(function, zoom, defaultValue);
+ return std::make_unique<CompositeFunctionPaintPropertyBinder<T, As...>>(function, zoom, defaultValue);
}
);
}