diff options
-rw-r--r-- | include/vcl/opengl/OpenGLContext.hxx | 5 | ||||
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 35 |
2 files changed, 11 insertions, 29 deletions
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx index 82a9d638abb3..28db7f9ed814 100644 --- a/include/vcl/opengl/OpenGLContext.hxx +++ b/include/vcl/opengl/OpenGLContext.hxx @@ -84,7 +84,6 @@ struct GLWindow #endif XVisualInfo* vi; GLXContext ctx; - GLXPixmap glPix; bool HasGLXExtension( const char* name ) const; const char* GLXExtensions; @@ -115,7 +114,6 @@ struct GLWindow #endif vi(nullptr), ctx(nullptr), - glPix(0), GLXExtensions(nullptr), #endif bpp(0), @@ -230,9 +228,6 @@ private: int mnRefCount; bool mbRequestLegacyContext; bool mbUseDoubleBufferedRendering; -#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) - bool mbPixmap; // is a pixmap instead of a window -#endif int mnFramebufferCount; OpenGLFramebuffer* mpCurrentFramebuffer; diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 6929bbc5b825..6670489efce1 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -71,10 +71,6 @@ OpenGLContext::OpenGLContext(): { VCL_GL_INFO("vcl.opengl", "new context: " << this); -#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) - mbPixmap = false; -#endif - ImplSVData* pSVData = ImplGetSVData(); if( pSVData->maGDIData.mpLastContext ) { @@ -727,7 +723,7 @@ bool OpenGLContext::ImplInit() pSharedCtx = g_vShareList.front(); #ifdef DBG_UTIL - if (!mbPixmap && glXCreateContextAttribsARB && !mbRequestLegacyContext) + if (glXCreateContextAttribsARB && !mbRequestLegacyContext) { int best_fbc = -1; GLXFBConfig* pFBC = getFBConfig(m_aGLWin.dpy, m_aGLWin.win, best_fbc, mbUseDoubleBufferedRendering, true); @@ -772,7 +768,7 @@ bool OpenGLContext::ImplInit() return false; } - if( !glXMakeCurrent( m_aGLWin.dpy, mbPixmap ? m_aGLWin.glPix : m_aGLWin.win, m_aGLWin.ctx ) ) + if( !glXMakeCurrent( m_aGLWin.dpy, m_aGLWin.win, m_aGLWin.ctx ) ) { SAL_WARN("vcl.opengl", "unable to select current GLX context"); return false; @@ -788,12 +784,7 @@ bool OpenGLContext::ImplInit() SAL_INFO("vcl.opengl", "available GL extensions: " << m_aGLWin.GLExtensions); XWindowAttributes xWinAttr; - if( mbPixmap ) - { - m_aGLWin.Width = 0; // FIXME: correct ? - m_aGLWin.Height = 0; - } - else if( !XGetWindowAttributes( m_aGLWin.dpy, m_aGLWin.win, &xWinAttr ) ) + if( !XGetWindowAttributes( m_aGLWin.dpy, m_aGLWin.win, &xWinAttr ) ) { SAL_WARN("vcl.opengl", "Failed to get window attributes on " << m_aGLWin.win); m_aGLWin.Width = 0; @@ -1278,9 +1269,6 @@ void OpenGLContext::reset() SAL_WARN("vcl.opengl", "glError: " << glGetError()); } glXDestroyContext(m_aGLWin.dpy, m_aGLWin.ctx); - - if (mbPixmap && m_aGLWin.glPix != None) - glXDestroyPixmap(m_aGLWin.dpy, m_aGLWin.glPix); m_aGLWin.ctx = nullptr; } #endif @@ -1350,17 +1338,16 @@ bool OpenGLContext::isCurrent() OpenGLZone aZone; #if defined( WNT ) - return (wglGetCurrentContext() == m_aGLWin.hRC && - wglGetCurrentDC() == m_aGLWin.hDC); + return wglGetCurrentContext() == m_aGLWin.hRC && + wglGetCurrentDC() == m_aGLWin.hDC; #elif defined( MACOSX ) (void) this; // loplugin:staticmethods return false; #elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS) return false; #elif defined( UNX ) - GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win; - return (m_aGLWin.ctx && glXGetCurrentContext() == m_aGLWin.ctx && - glXGetCurrentDrawable() == nDrawable); + return m_aGLWin.ctx && glXGetCurrentContext() == m_aGLWin.ctx && + glXGetCurrentDrawable() == m_aGLWin.win; #endif } @@ -1432,10 +1419,10 @@ void OpenGLContext::makeCurrent() if (m_aGLWin.dpy) { - GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win; - if (!glXMakeCurrent( m_aGLWin.dpy, nDrawable, m_aGLWin.ctx )) + if (!glXMakeCurrent( m_aGLWin.dpy, m_aGLWin.win, m_aGLWin.ctx )) { - SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent failed on drawable " << nDrawable << " pixmap? " << mbPixmap); + SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent failed " + "on drawable " << m_aGLWin.win); return; } } @@ -1497,7 +1484,7 @@ void OpenGLContext::swapBuffers() #elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS) // nothing #elif defined( UNX ) - glXSwapBuffers(m_aGLWin.dpy, mbPixmap ? m_aGLWin.glPix : m_aGLWin.win); + glXSwapBuffers(m_aGLWin.dpy, m_aGLWin.win); #endif } |