[Libreoffice-commits] core.git: vcl/inc vcl/opengl

Caolán McNamara caolanm at redhat.com
Fri Jan 27 08:53:47 UTC 2017


 vcl/inc/openglgdiimpl.hxx |    2 ++
 vcl/opengl/gdiimpl.cxx    |    8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 9a61fdbf0b64dac30a2fe098388cd20471cca7bb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 26 12:17:58 2017 +0000

    Related: tdf#105514 recursive fallback GetOpenGLContext
    
    Change-Id: Icb8f3751806ef9c1c7c92cd8b7cc7c28595eca22
    Reviewed-on: https://gerrit.libreoffice.org/33580
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index ea79b6c..f3d603c 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 9043926..c483fb0 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -75,6 +75,7 @@ OpenGLSalGraphicsImpl::OpenGLSalGraphicsImpl(SalGraphics& rParent, SalGeometryPr
     , mbUseScissor(false)
     , mbUseStencil(false)
     , mbXORMode(false)
+    , mbAcquiringOpenGLContext(false)
     , mnLineColor(SALCOLOR_NONE)
     , mnFillColor(SALCOLOR_NONE)
 #ifdef DBG_UTIL
@@ -100,7 +101,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;
 }


More information about the Libreoffice-commits mailing list