diff options
author | Mike Morris <michael.patrick.morris@gmail.com> | 2015-08-20 16:11:32 -0400 |
---|---|---|
committer | Mike Morris <michael.patrick.morris@gmail.com> | 2015-08-25 14:39:49 -0400 |
commit | 4540c3c0e8c80de4f0074c1c4328840ebf708470 (patch) | |
tree | ed131f161734d494655b05fe65b20c44d15f6daa /include/mbgl/platform | |
parent | 15a5532d76c387142db60913c4ce0876d4450eb8 (diff) | |
download | qtlocation-mapboxgl-4540c3c0e8c80de4f0074c1c4328840ebf708470.tar.gz |
View::swap -> View::beforeRender View::afterRender
To be able to resize the framebuffer on the map thread
in HeadlessView.
Diffstat (limited to 'include/mbgl/platform')
-rw-r--r-- | include/mbgl/platform/default/glfw_view.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/platform/default/headless_view.hpp | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp index ec99080732..17050d64db 100644 --- a/include/mbgl/platform/default/glfw_view.hpp +++ b/include/mbgl/platform/default/glfw_view.hpp @@ -24,7 +24,8 @@ public: void deactivate() override; void notify() override; void invalidate() override; - void swap() override; + void beforeRender() override; + void afterRender() override; static void onKey(GLFWwindow *window, int key, int scancode, int action, int mods); static void onScroll(GLFWwindow *window, double xoffset, double yoffset); diff --git a/include/mbgl/platform/default/headless_view.hpp b/include/mbgl/platform/default/headless_view.hpp index ce0ff2a685..50edc48428 100644 --- a/include/mbgl/platform/default/headless_view.hpp +++ b/include/mbgl/platform/default/headless_view.hpp @@ -37,9 +37,11 @@ public: void deactivate() override; void notify() override; void invalidate() override; - void swap() override; + void beforeRender() override; + void afterRender() override; std::unique_ptr<StillImage> readStillImage() override; + void resizeFramebuffer(); void resize(uint16_t width, uint16_t height); private: @@ -52,6 +54,7 @@ private: std::shared_ptr<HeadlessDisplay> display; const float pixelRatio; std::array<uint16_t, 2> dimensions; + bool needsResize; #if MBGL_USE_CGL CGLContextObj glContext = nullptr; |