summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/possibly_evaluated_property_value.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-07-13 18:14:12 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-07-20 11:56:30 -0700
commitc8edbb0500cbf4baf1d5fdb0e63679539e166585 (patch)
tree750f3b72b9e3b1c91ddbc0541cfc64d7d80ffe71 /src/mbgl/renderer/possibly_evaluated_property_value.hpp
parent6d7072162b764c2432c010cd463a5a2c0093d606 (diff)
downloadqtlocation-mapboxgl-c8edbb0500cbf4baf1d5fdb0e63679539e166585.tar.gz
[core] Replace {Source,Camera,Composite}Function with PropertyExpression
Diffstat (limited to 'src/mbgl/renderer/possibly_evaluated_property_value.hpp')
-rw-r--r--src/mbgl/renderer/possibly_evaluated_property_value.hpp23
1 files changed, 9 insertions, 14 deletions
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 <mbgl/style/function/source_function.hpp>
-#include <mbgl/style/function/composite_function.hpp>
+#include <mbgl/style/property_expression.hpp>
#include <mbgl/util/interpolate.hpp>
#include <mbgl/util/variant.hpp>
@@ -12,8 +11,7 @@ class PossiblyEvaluatedPropertyValue {
private:
using Value = variant<
T,
- style::SourceFunction<T>,
- style::CompositeFunction<T>>;
+ style::PropertyExpression<T>>;
Value value;
@@ -45,17 +43,14 @@ public:
template <class Feature>
T evaluate(const Feature& feature, float zoom, T defaultValue) const {
return this->match(
- [&] (const T& constant_) { return constant_; },
- [&] (const style::SourceFunction<T>& function) {
- return function.evaluate(feature, defaultValue);
- },
- [&] (const style::CompositeFunction<T>& 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<T>& expression) {
+ if (useIntegerZoom) {
+ return expression.evaluate(floor(zoom), feature, defaultValue);
+ } else {
+ return expression.evaluate(zoom, feature, defaultValue);
}
+ }
);
}