diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-01-06 16:09:09 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-01-06 16:13:30 +0000 |
commit | 0bea1d80d10a1e3e9bebf958d622ff2fb480e886 (patch) | |
tree | bea0a6365d149abb5c37b4baaa6ae128b4e9da32 /include | |
parent | 3b52c4492c468ee5dfbb97382f53a28bdf8c0f4c (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.hxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx index b93c12cc17fd..67570c104e13 100644 --- a/include/vcl/opengl/OpenGLContext.hxx +++ b/include/vcl/opengl/OpenGLContext.hxx @@ -199,8 +199,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(); |