From 4540c3c0e8c80de4f0074c1c4328840ebf708470 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 20 Aug 2015 16:11:32 -0400 Subject: View::swap -> View::beforeRender View::afterRender To be able to resize the framebuffer on the map thread in HeadlessView. --- include/mbgl/platform/default/glfw_view.hpp | 3 ++- include/mbgl/platform/default/headless_view.hpp | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'include/mbgl/platform') 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 readStillImage() override; + void resizeFramebuffer(); void resize(uint16_t width, uint16_t height); private: @@ -52,6 +54,7 @@ private: std::shared_ptr display; const float pixelRatio; std::array dimensions; + bool needsResize; #if MBGL_USE_CGL CGLContextObj glContext = nullptr; -- cgit v1.2.1