@@ -21,19 +21,20 @@ public:
|
||||
NetworkStatus::Set(NetworkStatus::Status::Offline);
|
||||
|
||||
map.getStyle().loadJSON(util::read_file("benchmark/fixtures/api/style.json"));
|
||||
map.jumpTo(CameraOptions().withCenter(LatLng { 40.726989, -73.992857 }).withZoom(15.0)); // Manhattan
|
||||
map.getStyle().addImage(std::make_unique<style::Image>("test-icon",
|
||||
decodeImage(util::read_file("benchmark/fixtures/api/default_marker.png")), 1.0f));
|
||||
map.jumpTo(CameraOptions().withCenter(LatLng{40.726989, -73.992857}).withZoom(15.0)); // Manhattan
|
||||
map.getStyle().addImage(std::make_unique<style::Image>(
|
||||
"test-icon", decodeImage(util::read_file("benchmark/fixtures/api/default_marker.png")), 1.0f));
|
||||
|
||||
frontend.render(map);
|
||||
}
|
||||
|
||||
util::RunLoop loop;
|
||||
HeadlessFrontend frontend { { 1000, 1000 }, 1 };
|
||||
Map map { frontend, MapObserver::nullObserver(),
|
||||
MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize()),
|
||||
ResourceOptions().withCachePath("benchmark/fixtures/api/cache.db").withAssetPath(".").withApiKey("foobar") };
|
||||
ScreenBox box{{ 0, 0 }, { 1000, 1000 }};
|
||||
HeadlessFrontend frontend{{1000, 1000}, 1};
|
||||
Map map{frontend,
|
||||
MapObserver::nullObserver(),
|
||||
MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize()),
|
||||
ResourceOptions().withCachePath("benchmark/fixtures/api/cache.db").withAssetPath(".").withApiKey("foobar")};
|
||||
ScreenBox box{{0, 0}, {1000, 1000}};
|
||||
};
|
||||
|
||||
} // end namespace
|
||||
@@ -74,7 +75,7 @@ static void API_queryRenderedFeaturesLayerFromLowDensity(::benchmark::State& sta
|
||||
QueryBenchmark bench;
|
||||
|
||||
while (state.KeepRunning()) {
|
||||
bench.frontend.getRenderer()->queryRenderedFeatures(bench.box, {{{ "testlayer" }}, {}});
|
||||
bench.frontend.getRenderer()->queryRenderedFeatures(bench.box, {{{"testlayer"}}, {}});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +83,7 @@ static void API_queryRenderedFeaturesLayerFromHighDensity(::benchmark::State& st
|
||||
QueryBenchmark bench;
|
||||
|
||||
while (state.KeepRunning()) {
|
||||
bench.frontend.getRenderer()->queryRenderedFeatures(bench.box, {{{"road-street" }}, {}});
|
||||
bench.frontend.getRenderer()->queryRenderedFeatures(bench.box, {{{"road-street"}}, {}});
|
||||
}
|
||||
}
|
||||
BENCHMARK(API_queryPixelsForLatLngs);
|
||||
|
||||
Reference in New Issue
Block a user