summaryrefslogtreecommitdiff
path: root/src/mbgl/gl
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-03-19 15:55:06 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-03-20 18:47:15 +0200
commit3122df7e5075bb05c99d7033fceb9e561e795874 (patch)
tree5ab1ef8a85225b63f09922dd3b014d4eadbe7841 /src/mbgl/gl
parentf86cc81680dd64f135f4f7b813c6cbb1e7e822d8 (diff)
downloadqtlocation-mapboxgl-3122df7e5075bb05c99d7033fceb9e561e795874.tar.gz
[core] Expose a way of flushing the graphics pipeline
Useful for apps before going to background that are restricted by the OS of performing any operation.
Diffstat (limited to 'src/mbgl/gl')
-rw-r--r--src/mbgl/gl/context.cpp4
-rw-r--r--src/mbgl/gl/context.hpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index bc703db401..5ce035f691 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -787,5 +787,9 @@ void Context::performCleanup() {
}
}
+void Context::flush() {
+ MBGL_CHECK_ERROR(glFinish());
+}
+
} // namespace gl
} // namespace mbgl
diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp
index 338a294b47..d9f27eacc0 100644
--- a/src/mbgl/gl/context.hpp
+++ b/src/mbgl/gl/context.hpp
@@ -116,6 +116,11 @@ public:
// Only call this while the OpenGL context is exclusive to this thread.
void reset();
+ // Flush pending graphics commands. Will block until the pipeline
+ // is empty. Should be used only with a very good reason because
+ // it will have a performance impact.
+ void flush();
+
bool empty() const {
return pooledTextures.empty()
&& abandonedPrograms.empty()