summaryrefslogtreecommitdiff
path: root/benchmark/api/render.benchmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/api/render.benchmark.cpp')
-rw-r--r--benchmark/api/render.benchmark.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/benchmark/api/render.benchmark.cpp b/benchmark/api/render.benchmark.cpp
index aea2af745a..1a00d9df12 100644
--- a/benchmark/api/render.benchmark.cpp
+++ b/benchmark/api/render.benchmark.cpp
@@ -4,9 +4,12 @@
#include <mbgl/map/map.hpp>
#include <mbgl/map/map_observer.hpp>
#include <mbgl/map/backend_scope.hpp>
+#include <mbgl/map/map_observer.hpp>
#include <mbgl/gl/headless_backend.hpp>
#include <mbgl/gl/offscreen_view.hpp>
#include <mbgl/util/default_thread_pool.hpp>
+#include <mbgl/renderer/renderer.hpp>
+#include <mbgl/renderer/async_renderer_frontend.hpp>
#include <mbgl/style/style.hpp>
#include <mbgl/style/image.hpp>
#include <mbgl/storage/default_file_source.hpp>
@@ -45,7 +48,8 @@ static void prepare(Map& map, optional<std::string> json = {}) {
static void API_renderStill_reuse_map(::benchmark::State& state) {
RenderBenchmark bench;
- Map map { bench.backend, MapObserver::nullObserver(), bench.view.getSize(), 1, bench.fileSource, bench.threadPool, MapMode::Still };
+ AsyncRendererFrontend frontend { std::make_unique<Renderer>(bench.backend, 1, bench.fileSource, bench.threadPool), bench.view };
+ Map map { frontend, MapObserver::nullObserver(), bench.view.getSize(), 1, bench.fileSource, bench.threadPool, MapMode::Still };
prepare(map);
while (state.KeepRunning()) {
@@ -55,7 +59,8 @@ static void API_renderStill_reuse_map(::benchmark::State& state) {
static void API_renderStill_reuse_map_switch_styles(::benchmark::State& state) {
RenderBenchmark bench;
- Map map { bench.backend, MapObserver::nullObserver(), bench.view.getSize(), 1, bench.fileSource, bench.threadPool, MapMode::Still };
+ AsyncRendererFrontend frontend { std::make_unique<Renderer>(bench.backend, 1, bench.fileSource, bench.threadPool), bench.view };
+ Map map { frontend, MapObserver::nullObserver(), bench.view.getSize(), 1, bench.fileSource, bench.threadPool, MapMode::Still };
while (state.KeepRunning()) {
prepare(map, { "{}" });
@@ -69,7 +74,8 @@ static void API_renderStill_recreate_map(::benchmark::State& state) {
RenderBenchmark bench;
while (state.KeepRunning()) {
- Map map { bench.backend, MapObserver::nullObserver(), bench.view.getSize(), 1, bench.fileSource, bench.threadPool, MapMode::Still };
+ AsyncRendererFrontend frontend { std::make_unique<Renderer>(bench.backend, 1, bench.fileSource, bench.threadPool), bench.view };
+ Map map { frontend, MapObserver::nullObserver(), bench.view.getSize(), 1, bench.fileSource, bench.threadPool, MapMode::Still };
prepare(map);
mbgl::benchmark::render(map, bench.view);
}