diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-01-06 16:09:09 +0000 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-01-07 12:45:10 +0100 |
commit | fb97ade682fffa577b28b76b08e6b3c9737723e9 (patch) | |
tree | bcb9ad2defc0a772823672094b4c28ac5a922cb0 /include | |
parent | 26ea69b37ebf0df035c494d7ac831cb15db1f1b3 (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 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(); |