summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-05-31 18:42:13 +0200
committerMolly Lloyd <mollymerp@users.noreply.github.com>2018-08-31 13:08:47 -0700
commit748e6bde5f611cfba3419c272d3cbf1d5c1350ef (patch)
treeef48e7be5a70aaf3b095c57f76f3fcd10b12080a /src
parentf97ba60da46445b15fcdea9bd6c1d7ceb63138e2 (diff)
downloadqtlocation-mapboxgl-748e6bde5f611cfba3419c272d3cbf1d5c1350ef.tar.gz
[core] allow passing multiple AttributeTypes to a PaintPropertyBinder
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/renderer/paint_property_binder.hpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mbgl/renderer/paint_property_binder.hpp b/src/mbgl/renderer/paint_property_binder.hpp
index 82c36399a9..cf0a71847e 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::PropertyExpression<T>& expression) -> std::unique_ptr<PaintPropertyBinder<T, A>> {
+ [&] (const style::PropertyExpression<T>& expression) -> std::unique_ptr<PaintPropertyBinder<T, As...>> {
if (expression.isZoomConstant()) {
- return std::make_unique<SourceFunctionPaintPropertyBinder<T, A>>(expression, defaultValue);
+ return std::make_unique<SourceFunctionPaintPropertyBinder<T, As...>>(expression, defaultValue);
} else {
- return std::make_unique<CompositeFunctionPaintPropertyBinder<T, A>>(expression, zoom, defaultValue);
+ return std::make_unique<CompositeFunctionPaintPropertyBinder<T, As...>>(expression, zoom, defaultValue);
}
}
);