summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-01-06 16:09:09 +0000
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-01-07 12:45:10 +0100
commitfb97ade682fffa577b28b76b08e6b3c9737723e9 (patch)
treebcb9ad2defc0a772823672094b4c28ac5a922cb0 /include
parent26ea69b37ebf0df035c494d7ac831cb15db1f1b3 (diff)
vcl: reset OpenGLContext(s) when yielding the last SolarMutex.
This should make OpenGL thread-safe to allow multiple threads to render using VCL's OpenGL backend, and fix misc. associated driver horrors, will give some performance cost for tight Yield loops. Change-Id: Ib23702262fd9f0925a5ed8c642d0a26e92136b37
Diffstat (limited to 'include')
-rw-r--r--include/vcl/opengl/OpenGLContext.hxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index a98f82592e1b..30e52611446f 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -222,8 +222,14 @@ public:
OpenGLProgram* UseProgram( const OUString& rVertexShader, const OUString& rFragmentShader );
bool isCurrent();
- void clearCurrent();
+ static void clearCurrent();
+ /// reset all contexts dis-associating them with their underlying
+ /// resources before a potential thread switch.
+ static void resetAllContexts();
+
+ /// make this GL context current - so it is implicit in subsequent GL calls
void makeCurrent();
+ /// reset the GL context so this context is not implicit in subsequent GL calls.
void resetCurrent();
void swapBuffers();
void sync();