summaryrefslogtreecommitdiff
path: root/benchmark/api/query.benchmark.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-07 23:24:52 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-08 18:37:41 +0200
commit2144e3f3b0b8f08b65c854225d7360847633f689 (patch)
tree16cadc63b1c3d438c5ddd4bf67aadb2e72e23130 /benchmark/api/query.benchmark.cpp
parent2f88e8257b83b77f6c06c86c99f542976e7d5199 (diff)
downloadqtlocation-mapboxgl-2144e3f3b0b8f08b65c854225d7360847633f689.tar.gz
[core] Implement platform::Factory::sharedFileSource()upstream/map-refactor
Diffstat (limited to 'benchmark/api/query.benchmark.cpp')
-rw-r--r--benchmark/api/query.benchmark.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/benchmark/api/query.benchmark.cpp b/benchmark/api/query.benchmark.cpp
index ab2adbacee..21f57acbc9 100644
--- a/benchmark/api/query.benchmark.cpp
+++ b/benchmark/api/query.benchmark.cpp
@@ -6,7 +6,7 @@
#include <mbgl/renderer/renderer.hpp>
#include <mbgl/style/style.hpp>
#include <mbgl/style/image.hpp>
-#include <mbgl/storage/default_file_source.hpp>
+#include <mbgl/storage/file_source_options.hpp>
#include <mbgl/storage/network_status.hpp>
#include <mbgl/util/image.hpp>
#include <mbgl/util/io.hpp>
@@ -20,7 +20,6 @@ class QueryBenchmark {
public:
QueryBenchmark() {
NetworkStatus::Set(NetworkStatus::Status::Offline);
- fileSource.setAccessToken("foobar");
map.getStyle().loadJSON(util::read_file("benchmark/fixtures/api/style.json"));
map.jumpTo(CameraOptions().withCenter(LatLng { 40.726989, -73.992857 }).withZoom(15.0)); // Manhattan
@@ -30,11 +29,12 @@ public:
frontend.render(map);
}
+ FileSourceOptions fileSourceOptions = FileSourceOptions().withCachePath("benchmark/fixtures/api/cache.db").withAccessToken("foobar");
+
util::RunLoop loop;
- DefaultFileSource fileSource{ "benchmark/fixtures/api/cache.db", "." };
- HeadlessFrontend frontend { { 1000, 1000 }, 1, fileSource };
+ HeadlessFrontend frontend { { 1000, 1000 }, 1.0, fileSourceOptions };
Map map { frontend, MapObserver::nullObserver(), frontend.getSize(), 1,
- fileSource, MapOptions().withMapMode(MapMode::Static) };
+ MapOptions().withMapMode(MapMode::Static), fileSourceOptions };
ScreenBox box{{ 0, 0 }, { 1000, 1000 }};
};