From c8edbb0500cbf4baf1d5fdb0e63679539e166585 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 13 Jul 2018 18:14:12 -0700 Subject: [core] Replace {Source,Camera,Composite}Function with PropertyExpression --- .../renderer/possibly_evaluated_property_value.hpp | 23 +++++++++------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'src/mbgl/renderer/possibly_evaluated_property_value.hpp') diff --git a/src/mbgl/renderer/possibly_evaluated_property_value.hpp b/src/mbgl/renderer/possibly_evaluated_property_value.hpp index e662d5dfb1..f2d265f2f7 100644 --- a/src/mbgl/renderer/possibly_evaluated_property_value.hpp +++ b/src/mbgl/renderer/possibly_evaluated_property_value.hpp @@ -1,7 +1,6 @@ #pragma once -#include -#include +#include #include #include @@ -12,8 +11,7 @@ class PossiblyEvaluatedPropertyValue { private: using Value = variant< T, - style::SourceFunction, - style::CompositeFunction>; + style::PropertyExpression>; Value value; @@ -45,17 +43,14 @@ public: template T evaluate(const Feature& feature, float zoom, T defaultValue) const { return this->match( - [&] (const T& constant_) { return constant_; }, - [&] (const style::SourceFunction& function) { - return function.evaluate(feature, defaultValue); - }, - [&] (const style::CompositeFunction& function) { - if (useIntegerZoom) { - return function.evaluate(floor(zoom), feature, defaultValue); - } else { - return function.evaluate(zoom, feature, defaultValue); - } + [&] (const T& constant_) { return constant_; }, + [&] (const style::PropertyExpression& expression) { + if (useIntegerZoom) { + return expression.evaluate(floor(zoom), feature, defaultValue); + } else { + return expression.evaluate(zoom, feature, defaultValue); } + } ); } -- cgit v1.2.1