summaryrefslogtreecommitdiff
path: root/benchmark/src/mbgl/benchmark/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/src/mbgl/benchmark/util.cpp')
-rw-r--r--benchmark/src/mbgl/benchmark/util.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/benchmark/src/mbgl/benchmark/util.cpp b/benchmark/src/mbgl/benchmark/util.cpp
new file mode 100644
index 0000000000..a8f71f1206
--- /dev/null
+++ b/benchmark/src/mbgl/benchmark/util.cpp
@@ -0,0 +1,22 @@
+#include <mbgl/benchmark/util.hpp>
+
+#include <mbgl/map/map.hpp>
+#include <mbgl/util/image.hpp>
+#include <mbgl/util/run_loop.hpp>
+
+namespace mbgl {
+namespace benchmark {
+
+void render(Map& map) {
+ PremultipliedImage result;
+ map.renderStill([&result](std::exception_ptr, PremultipliedImage&& image) {
+ result = std::move(image);
+ });
+
+ while (!result.size()) {
+ util::RunLoop::Get()->runOnce();
+ }
+}
+
+} // namespace benchmark
+} // namespace mbgl