summaryrefslogtreecommitdiff
path: root/include/mbgl/renderer
diff options
context:
space:
mode:
authorLeith Bade <leith@leithalweapon.geek.nz>2014-06-24 00:41:28 +1000
committerMike Morris <michael.patrick.morris@gmail.com>2014-09-10 18:31:20 -0400
commit71549e7b93b6b44ed38e8915d8735c136889c3f1 (patch)
tree41713e8771be946304e9f04cf4477b34e17cd6e8 /include/mbgl/renderer
parentc004c036964e9012b08aa4a2f8b16094630d62be (diff)
downloadqtlocation-mapboxgl-71549e7b93b6b44ed38e8915d8735c136889c3f1.tar.gz
Adds the function Map::terminate() to allow all GL resources held
by the map to be released immediately. Map::terminate() will call any GL functions on the current thread without blocking or defering to the rendering thread. This function allows a GL context to be destroyed and recreated safely without having to delete the Map object. Fixes mapbox/mapbox-gl-native#341 Conflicts: include/llmr/renderer/painter.hpp test/headless.cpp
Diffstat (limited to 'include/mbgl/renderer')
-rw-r--r--include/mbgl/renderer/painter.hpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/mbgl/renderer/painter.hpp b/include/mbgl/renderer/painter.hpp
index 75529d1136..15331b9b67 100644
--- a/include/mbgl/renderer/painter.hpp
+++ b/include/mbgl/renderer/painter.hpp
@@ -63,6 +63,7 @@ public:
// lazy initialization) in case rendering continues.
void cleanup();
+ void terminate();
// Renders the backdrop of the OpenGL view. This also paints in areas where we don't have any
// tiles whatsoever.
@@ -123,6 +124,7 @@ public:
private:
void setupShaders();
+ void deleteShaders();
mat4 translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor);
void prepareTile(const Tile& tile);