summaryrefslogtreecommitdiff
path: root/include/vcl/opengl/OpenGLContext.hxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-01-05 16:17:41 +0000
committerMichael Meeks <michael.meeks@collabora.com>2016-01-06 09:17:16 +0000
commit1479ad1c632a7511468fc5133e4fd747062c376f (patch)
treec0d919f8d43b480cfd9131a6b385643838078303 /include/vcl/opengl/OpenGLContext.hxx
parent3576a87d72dd138d3bb2ce6bbba8df05ca983289 (diff)
vcl: opengl - Kill the last glErrors on common paths.
Re-work the makeSomeOpenGLContextCurrent logic into a shared function with the existing AcquireContext logic in the SalOpenGLGraphics impl. Use an OpenGLVCLContextZone placeholder to do both context and zone management - to include destructors into the zone. Fix a number of error cases around SalBitmaps where we did not have a GL context associated when allocating, and/or freeing textures.. Don't drag a (potentially) slower context around in the OpenGLSalBitmap when we're going to check / fetch a better VCL context anyway. Change-Id: Ibbb2358c47156cd078ad28b6aad4f03af36aaf23 Reviewed-on: https://gerrit.libreoffice.org/21127 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'include/vcl/opengl/OpenGLContext.hxx')
-rw-r--r--include/vcl/opengl/OpenGLContext.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index b2a0f09412e1..de22444d47d6 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -174,6 +174,11 @@ public:
static void prepareForYield();
/// Is there a current GL context ?
static bool hasCurrent();
+
+ /// make a VCL context (any context) current, create it if necessary.
+ static void makeVCLCurrent();
+ /// fetch any VCL context, creating one if @bMakeIfNecessary is set.
+ static rtl::Reference<OpenGLContext> getVCLContext(bool bMakeIfNecessary = true);
/// make this GL context current - so it is implicit in subsequent GL calls
void makeCurrent();
/// Put this GL context to the end of the context list.