summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-10-09 16:47:32 +0300
committerFabian Guerra Soto <fabian.guerra@mapbox.com>2017-11-01 09:23:53 -0400
commitdf7755fcd98f98ed546cc02b1ada6feda66a3125 (patch)
tree20c4ce3e96ab88d9ea27c522b0f46b459ce94b8a
parente9568ccda78bc076b2923b7645c885b78971202a (diff)
downloadqtlocation-mapboxgl-df7755fcd98f98ed546cc02b1ada6feda66a3125.tar.gz
[default] headless frontend - allow access to the transform state
-rw-r--r--platform/default/mbgl/gl/headless_frontend.cpp10
-rw-r--r--platform/default/mbgl/gl/headless_frontend.hpp3
2 files changed, 13 insertions, 0 deletions
diff --git a/platform/default/mbgl/gl/headless_frontend.cpp b/platform/default/mbgl/gl/headless_frontend.cpp
index 5d2932258a..2cbb624bd0 100644
--- a/platform/default/mbgl/gl/headless_frontend.cpp
+++ b/platform/default/mbgl/gl/headless_frontend.cpp
@@ -1,6 +1,8 @@
#include <mbgl/gl/headless_frontend.hpp>
#include <mbgl/renderer/renderer.hpp>
+#include <mbgl/renderer/update_parameters.hpp>
#include <mbgl/map/map.hpp>
+#include <mbgl/map/transform_state.hpp>
#include <mbgl/util/run_loop.hpp>
namespace mbgl {
@@ -83,4 +85,12 @@ PremultipliedImage HeadlessFrontend::render(Map& map) {
return result;
}
+optional<TransformState> HeadlessFrontend::getTransformState() const {
+ if (updateParameters) {
+ return updateParameters->transformState;
+ } else {
+ return {};
+ }
+}
+
} // namespace mbgl
diff --git a/platform/default/mbgl/gl/headless_frontend.hpp b/platform/default/mbgl/gl/headless_frontend.hpp
index 33503bc13b..4d1116904e 100644
--- a/platform/default/mbgl/gl/headless_frontend.hpp
+++ b/platform/default/mbgl/gl/headless_frontend.hpp
@@ -14,6 +14,7 @@ class Scheduler;
class Renderer;
class RendererBackend;
class Map;
+class TransformState;
class HeadlessFrontend : public RendererFrontend {
public:
@@ -34,6 +35,8 @@ public:
PremultipliedImage readStillImage();
PremultipliedImage render(Map&);
+ optional<TransformState> getTransformState() const;
+
private:
Size size;
float pixelRatio;