summaryrefslogtreecommitdiff
path: root/benchmark/src
diff options
context:
space:
mode:
authorAnand Thakker <anandthakker@users.noreply.github.com>2017-08-29 10:03:57 -0400
committerGitHub <noreply@github.com>2017-08-29 10:03:57 -0400
commitd436bcd56b2a2b68195f546c11919dd46e8049ce (patch)
treec9eccd5a1248e5128a47e4f643f5afd2c7621773 /benchmark/src
parenta2712f6fa439af976f7c17685b78340cb14d67a1 (diff)
downloadqtlocation-mapboxgl-d436bcd56b2a2b68195f546c11919dd46e8049ce.tar.gz
Add {Source,CompositeCamera}Function benchmarks (#9838)
Diffstat (limited to 'benchmark/src')
-rw-r--r--benchmark/src/mbgl/benchmark/stub_geometry_tile_feature.hpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/benchmark/src/mbgl/benchmark/stub_geometry_tile_feature.hpp b/benchmark/src/mbgl/benchmark/stub_geometry_tile_feature.hpp
new file mode 100644
index 0000000000..e27aeeb48b
--- /dev/null
+++ b/benchmark/src/mbgl/benchmark/stub_geometry_tile_feature.hpp
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <mbgl/tile/geometry_tile_data.hpp>
+#include <mbgl/util/feature.hpp>
+
+using namespace mbgl;
+
+class StubGeometryTileFeature : public GeometryTileFeature {
+public:
+ StubGeometryTileFeature(PropertyMap properties_)
+ : properties(std::move(properties_)) {
+ }
+
+ StubGeometryTileFeature(optional<FeatureIdentifier> id_, FeatureType type_, GeometryCollection geometry_, PropertyMap properties_)
+ : properties(std::move(properties_)),
+ id(std::move(id_)),
+ type(type_),
+ geometry(std::move(geometry_)) {
+ }
+
+ PropertyMap properties;
+ optional<FeatureIdentifier> id;
+ FeatureType type = FeatureType::Point;
+ GeometryCollection geometry;
+
+ FeatureType getType() const override {
+ return type;
+ }
+
+ optional<FeatureIdentifier> getID() const override {
+ return id;
+ }
+
+ optional<Value> getValue(const std::string& key) const override {
+ return properties.count(key) ? properties.at(key) : optional<Value>();
+ }
+
+ GeometryCollection getGeometries() const override {
+ return geometry;
+ }
+};