summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeith Bade <leith@leithalweapon.geek.nz>2014-06-24 00:25:20 +1000
committerMike Morris <michael.patrick.morris@gmail.com>2014-09-10 18:21:03 -0400
commitc004c036964e9012b08aa4a2f8b16094630d62be (patch)
treebe5f77b5286b924616a91f574c453bf3aa463ced /include
parentc836bc2b01c1c8642875d86126c1ef2a76dfd359 (diff)
downloadqtlocation-mapboxgl-c004c036964e9012b08aa4a2f8b16094630d62be.tar.gz
Add View::make_inactive() to remove context from rendering thread
View::make_inactive() is called just before termination of the rendering thread. The implementation must clear the thread's GL context. This ensures there is no context still bound to a thread during GL shutdown. This is needed as GL will not actually delete a context until it is not active on any thread. Fixes mapbox/mapbox-gl-native#340 Conflicts: common/glfw_view.hpp include/llmr/map/view.hpp test/headless.cpp
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/view.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbgl/map/view.hpp b/include/mbgl/map/view.hpp
index 92d60d4d02..3e2f1a4b5a 100644
--- a/include/mbgl/map/view.hpp
+++ b/include/mbgl/map/view.hpp
@@ -35,6 +35,10 @@ public:
// renderer setup since the render thread doesn't switch the contexts.
virtual void make_active() = 0;
+ // Called from the render thread. Makes the GL context inactive in the current
+ // thread. This is called once just before the rendering thread terminates.
+ virtual void make_inactive() = 0;
+
// Returns the base framebuffer object, if any, and 0 if using the system
// provided framebuffer.
virtual unsigned int root_fbo() {