blob: 0befd7c3e81ce06457c7ad93f98b45e208b2aa2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <mbgl/benchmark/util.hpp>
#include <mbgl/platform/default/offscreen_view.hpp>
#include <mbgl/map/map.hpp>
#include <mbgl/map/view.hpp>
#include <mbgl/util/image.hpp>
#include <mbgl/util/run_loop.hpp>
namespace mbgl {
namespace benchmark {
void render(Map& map, OffscreenView& view) {
PremultipliedImage result;
map.renderStill(view, [&](std::exception_ptr) {
result = view.readStillImage();
});
while (!result.valid()) {
util::RunLoop::Get()->runOnce();
}
}
} // namespace benchmark
} // namespace mbgl
|