diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-05-22 15:56:05 +0200 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-06-26 10:32:06 -0700 |
commit | 84e2ea886dc55917a1d6b665337fff6d3862984a (patch) | |
tree | 75d7411f09f48aa8b35be9348bc3687cb4efb1f8 /include/mbgl/platform | |
parent | 740281cc89e99fbbedf07fcf62253ada84f60776 (diff) | |
download | qtlocation-mapboxgl-84e2ea886dc55917a1d6b665337fff6d3862984a.tar.gz |
drive map rendering from main thread
Diffstat (limited to 'include/mbgl/platform')
-rw-r--r-- | include/mbgl/platform/default/glfw_view.hpp | 6 | ||||
-rw-r--r-- | include/mbgl/platform/default/headless_view.hpp | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp index 9a7e29fe29..6e03953cbd 100644 --- a/include/mbgl/platform/default/glfw_view.hpp +++ b/include/mbgl/platform/default/glfw_view.hpp @@ -8,6 +8,8 @@ #endif #include <GLFW/glfw3.h> +#include <atomic> + class GLFWView : public mbgl::View { public: GLFWView(bool fullscreen = false); @@ -17,7 +19,8 @@ public: void activate() override; void deactivate() override; void notify() override; - void invalidate(std::function<void()> render) override; + void invalidate() override; + void swap() override; static void onKey(GLFWwindow *window, int key, int scancode, int action, int mods); static void onScroll(GLFWwindow *window, double xoffset, double yoffset); @@ -62,6 +65,7 @@ private: std::function<void()> changeStyleCallback; GLFWwindow *window = nullptr; + std::atomic_flag clean = ATOMIC_FLAG_INIT; }; #endif diff --git a/include/mbgl/platform/default/headless_view.hpp b/include/mbgl/platform/default/headless_view.hpp index 66f13cf5bf..61e60ebaff 100644 --- a/include/mbgl/platform/default/headless_view.hpp +++ b/include/mbgl/platform/default/headless_view.hpp @@ -33,7 +33,8 @@ public: void deactivate() override; void notify() override; void resize(uint16_t width, uint16_t height, float pixelRatio) override; - void invalidate(std::function<void()> render) override; + void invalidate() override; + void swap() override; std::unique_ptr<StillImage> readStillImage() override; private: |