include/vcl/opengl/OpenGLContext.hxx | 5 ----- vcl/source/opengl/OpenGLContext.cxx | 35 +++++++++++------------------------ 2 files changed, 11 insertions(+), 29 deletions(-)
New commits: commit 9801b2c24c3115b52de3f6958eb462648d702491 Author: Michael Meeks <michael.me...@collabora.com> Date: Mon Nov 16 14:51:28 2015 +0000 opengl: remove unused mbPixmap & glPix members. We use textures bound to FBO's for everything in recent times. Change-Id: I7c9068d75b3653a2ceff0056e2ade1f27955422f Reviewed-on: https://gerrit.libreoffice.org/19995 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Meeks <michael.me...@collabora.com> diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx index 82a9d63..28db7f9 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 6929bbc..6670489 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 } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits