summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-26 12:17:58 +0000
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-02-01 13:36:46 +0000
commitbafb52624869a5078636a462a06fd65b9efaf04b (patch)
tree47ef4bbb8984885eb6b1f2e8e1c41b9b865c13f2 /vcl
parent04b7757da617594347bcdfb1965d8129efce074a (diff)
Related: tdf#105514 recursive fallback GetOpenGLContext
Change-Id: Icb8f3751806ef9c1c7c92cd8b7cc7c28595eca22 Reviewed-on: https://gerrit.libreoffice.org/33580 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 9a61fdbf0b64dac30a2fe098388cd20471cca7bb) Reviewed-on: https://gerrit.libreoffice.org/33747 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/openglgdiimpl.hxx2
-rw-r--r--vcl/opengl/gdiimpl.cxx8
2 files changed, 9 insertions, 1 deletions
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index 1457004e9ddc..e12d7818cf54 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -83,6 +83,8 @@ protected:
bool mbXORMode;
+ bool mbAcquiringOpenGLContext;
+
/**
* All rendering happens to this off-screen texture. For
* non-virtual devices, ie. windows - we will blit it and
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index b487468f10eb..47fa5d372d56 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -76,6 +76,7 @@ OpenGLSalGraphicsImpl::OpenGLSalGraphicsImpl(SalGraphics& rParent, SalGeometryPr
, mbUseScissor(false)
, mbUseStencil(false)
, mbXORMode(false)
+ , mbAcquiringOpenGLContext(false)
, mnLineColor(SALCOLOR_NONE)
, mnFillColor(SALCOLOR_NONE)
#ifdef DBG_UTIL
@@ -101,7 +102,12 @@ OpenGLSalGraphicsImpl::~OpenGLSalGraphicsImpl()
rtl::Reference<OpenGLContext> OpenGLSalGraphicsImpl::GetOpenGLContext()
{
- if( !AcquireContext(true) )
+ if (mbAcquiringOpenGLContext)
+ return nullptr;
+ mbAcquiringOpenGLContext = true;
+ bool bSuccess = AcquireContext(true);
+ mbAcquiringOpenGLContext = false;
+ if (!bSuccess)
return nullptr;
return mpContext;
}