summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-27 19:17:04 +0200
committerSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-28 16:41:15 +0200
commit7af00a404f22742fed4a83e9a36d023d7515025f (patch)
treeac050d12346d81030969f88607dbfd59ca33be11 /benchmark
parentf5064e710884d5b822e59d05e51c127c8b3e852b (diff)
downloadqtlocation-mapboxgl-7af00a404f22742fed4a83e9a36d023d7515025f.tar.gz
[core] Include pixelRatio property in MapOptions
Move pixelRatio property from Map constructor to MapOptions.
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/api/query.benchmark.cpp2
-rw-r--r--benchmark/api/render.benchmark.cpp19
2 files changed, 12 insertions, 9 deletions
diff --git a/benchmark/api/query.benchmark.cpp b/benchmark/api/query.benchmark.cpp
index 1db958c1be..9b7c2d7273 100644
--- a/benchmark/api/query.benchmark.cpp
+++ b/benchmark/api/query.benchmark.cpp
@@ -32,7 +32,7 @@ public:
util::RunLoop loop;
ThreadPool threadPool{ 4 };
HeadlessFrontend frontend { { 1000, 1000 }, 1, threadPool };
- Map map { frontend, MapObserver::nullObserver(), 1, threadPool,
+ Map map { frontend, MapObserver::nullObserver(), threadPool,
MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize()),
ResourceOptions().withCachePath("benchmark/fixtures/api/cache.db").withAssetPath(".").withAccessToken("foobar") };
ScreenBox box{{ 0, 0 }, { 1000, 1000 }};
diff --git a/benchmark/api/render.benchmark.cpp b/benchmark/api/render.benchmark.cpp
index 378ea705f1..3cff0d9056 100644
--- a/benchmark/api/render.benchmark.cpp
+++ b/benchmark/api/render.benchmark.cpp
@@ -45,8 +45,8 @@ static void prepare(Map& map, optional<std::string> json = {}) {
static void API_renderStill_reuse_map(::benchmark::State& state) {
RenderBenchmark bench;
HeadlessFrontend frontend { size, pixelRatio, bench.threadPool };
- Map map { frontend, MapObserver::nullObserver(), pixelRatio, bench.threadPool,
- MapOptions().withMapMode(MapMode::Static).withSize(size),
+ Map map { frontend, MapObserver::nullObserver(), bench.threadPool,
+ MapOptions().withMapMode(MapMode::Static).withSize(size).withPixelRatio(pixelRatio),
ResourceOptions().withCachePath(cachePath).withAccessToken("foobar") };
prepare(map);
@@ -58,8 +58,9 @@ static void API_renderStill_reuse_map(::benchmark::State& state) {
static void API_renderStill_reuse_map_formatted_labels(::benchmark::State& state) {
RenderBenchmark bench;
HeadlessFrontend frontend { size, pixelRatio, bench.threadPool };
- Map map { frontend, MapObserver::nullObserver(), pixelRatio, bench.threadPool,
- MapOptions().withMapMode(MapMode::Static).withSize(size), ResourceOptions().withCachePath(cachePath).withAccessToken("foobar") };
+ Map map { frontend, MapObserver::nullObserver(), bench.threadPool,
+ MapOptions().withMapMode(MapMode::Static).withSize(size).withPixelRatio(pixelRatio),
+ ResourceOptions().withCachePath(cachePath).withAccessToken("foobar") };
prepare(map, util::read_file("benchmark/fixtures/api/style_formatted_labels.json"));
while (state.KeepRunning()) {
@@ -70,8 +71,9 @@ static void API_renderStill_reuse_map_formatted_labels(::benchmark::State& state
static void API_renderStill_reuse_map_switch_styles(::benchmark::State& state) {
RenderBenchmark bench;
HeadlessFrontend frontend { size, pixelRatio, bench.threadPool };
- Map map { frontend, MapObserver::nullObserver(), pixelRatio, bench.threadPool,
- MapOptions().withMapMode(MapMode::Static).withSize(size), ResourceOptions().withCachePath(cachePath).withAccessToken("foobar") };
+ Map map { frontend, MapObserver::nullObserver(), bench.threadPool,
+ MapOptions().withMapMode(MapMode::Static).withSize(size).withPixelRatio(pixelRatio),
+ ResourceOptions().withCachePath(cachePath).withAccessToken("foobar") };
while (state.KeepRunning()) {
prepare(map, { "{}" });
@@ -86,8 +88,9 @@ static void API_renderStill_recreate_map(::benchmark::State& state) {
while (state.KeepRunning()) {
HeadlessFrontend frontend { size, pixelRatio, bench.threadPool };
- Map map { frontend, MapObserver::nullObserver(), pixelRatio, bench.threadPool,
- MapOptions().withMapMode(MapMode::Static).withSize(size), ResourceOptions().withCachePath(cachePath).withAccessToken("foobar") };
+ Map map { frontend, MapObserver::nullObserver(), bench.threadPool,
+ MapOptions().withMapMode(MapMode::Static).withSize(size).withPixelRatio(pixelRatio),
+ ResourceOptions().withCachePath(cachePath).withAccessToken("foobar") };
prepare(map);
frontend.render(map);
}