Kaydet (Commit) 9801b2c2 authored tarafından Michael Meeks's avatar Michael Meeks

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/19995Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 4ad05823
...@@ -84,7 +84,6 @@ struct GLWindow ...@@ -84,7 +84,6 @@ struct GLWindow
#endif #endif
XVisualInfo* vi; XVisualInfo* vi;
GLXContext ctx; GLXContext ctx;
GLXPixmap glPix;
bool HasGLXExtension( const char* name ) const; bool HasGLXExtension( const char* name ) const;
const char* GLXExtensions; const char* GLXExtensions;
...@@ -115,7 +114,6 @@ struct GLWindow ...@@ -115,7 +114,6 @@ struct GLWindow
#endif #endif
vi(nullptr), vi(nullptr),
ctx(nullptr), ctx(nullptr),
glPix(0),
GLXExtensions(nullptr), GLXExtensions(nullptr),
#endif #endif
bpp(0), bpp(0),
...@@ -230,9 +228,6 @@ private: ...@@ -230,9 +228,6 @@ private:
int mnRefCount; int mnRefCount;
bool mbRequestLegacyContext; bool mbRequestLegacyContext;
bool mbUseDoubleBufferedRendering; 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; int mnFramebufferCount;
OpenGLFramebuffer* mpCurrentFramebuffer; OpenGLFramebuffer* mpCurrentFramebuffer;
......
...@@ -71,10 +71,6 @@ OpenGLContext::OpenGLContext(): ...@@ -71,10 +71,6 @@ OpenGLContext::OpenGLContext():
{ {
VCL_GL_INFO("vcl.opengl", "new context: " << this); 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(); ImplSVData* pSVData = ImplGetSVData();
if( pSVData->maGDIData.mpLastContext ) if( pSVData->maGDIData.mpLastContext )
{ {
...@@ -727,7 +723,7 @@ bool OpenGLContext::ImplInit() ...@@ -727,7 +723,7 @@ bool OpenGLContext::ImplInit()
pSharedCtx = g_vShareList.front(); pSharedCtx = g_vShareList.front();
#ifdef DBG_UTIL #ifdef DBG_UTIL
if (!mbPixmap && glXCreateContextAttribsARB && !mbRequestLegacyContext) if (glXCreateContextAttribsARB && !mbRequestLegacyContext)
{ {
int best_fbc = -1; int best_fbc = -1;
GLXFBConfig* pFBC = getFBConfig(m_aGLWin.dpy, m_aGLWin.win, best_fbc, mbUseDoubleBufferedRendering, true); GLXFBConfig* pFBC = getFBConfig(m_aGLWin.dpy, m_aGLWin.win, best_fbc, mbUseDoubleBufferedRendering, true);
...@@ -772,7 +768,7 @@ bool OpenGLContext::ImplInit() ...@@ -772,7 +768,7 @@ bool OpenGLContext::ImplInit()
return false; 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"); SAL_WARN("vcl.opengl", "unable to select current GLX context");
return false; return false;
...@@ -788,12 +784,7 @@ bool OpenGLContext::ImplInit() ...@@ -788,12 +784,7 @@ bool OpenGLContext::ImplInit()
SAL_INFO("vcl.opengl", "available GL extensions: " << m_aGLWin.GLExtensions); SAL_INFO("vcl.opengl", "available GL extensions: " << m_aGLWin.GLExtensions);
XWindowAttributes xWinAttr; XWindowAttributes xWinAttr;
if( mbPixmap ) if( !XGetWindowAttributes( m_aGLWin.dpy, m_aGLWin.win, &xWinAttr ) )
{
m_aGLWin.Width = 0; // FIXME: correct ?
m_aGLWin.Height = 0;
}
else if( !XGetWindowAttributes( m_aGLWin.dpy, m_aGLWin.win, &xWinAttr ) )
{ {
SAL_WARN("vcl.opengl", "Failed to get window attributes on " << m_aGLWin.win); SAL_WARN("vcl.opengl", "Failed to get window attributes on " << m_aGLWin.win);
m_aGLWin.Width = 0; m_aGLWin.Width = 0;
...@@ -1278,9 +1269,6 @@ void OpenGLContext::reset() ...@@ -1278,9 +1269,6 @@ void OpenGLContext::reset()
SAL_WARN("vcl.opengl", "glError: " << glGetError()); SAL_WARN("vcl.opengl", "glError: " << glGetError());
} }
glXDestroyContext(m_aGLWin.dpy, m_aGLWin.ctx); glXDestroyContext(m_aGLWin.dpy, m_aGLWin.ctx);
if (mbPixmap && m_aGLWin.glPix != None)
glXDestroyPixmap(m_aGLWin.dpy, m_aGLWin.glPix);
m_aGLWin.ctx = nullptr; m_aGLWin.ctx = nullptr;
} }
#endif #endif
...@@ -1350,17 +1338,16 @@ bool OpenGLContext::isCurrent() ...@@ -1350,17 +1338,16 @@ bool OpenGLContext::isCurrent()
OpenGLZone aZone; OpenGLZone aZone;
#if defined( WNT ) #if defined( WNT )
return (wglGetCurrentContext() == m_aGLWin.hRC && return wglGetCurrentContext() == m_aGLWin.hRC &&
wglGetCurrentDC() == m_aGLWin.hDC); wglGetCurrentDC() == m_aGLWin.hDC;
#elif defined( MACOSX ) #elif defined( MACOSX )
(void) this; // loplugin:staticmethods (void) this; // loplugin:staticmethods
return false; return false;
#elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS) #elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
return false; return false;
#elif defined( UNX ) #elif defined( UNX )
GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win; return m_aGLWin.ctx && glXGetCurrentContext() == m_aGLWin.ctx &&
return (m_aGLWin.ctx && glXGetCurrentContext() == m_aGLWin.ctx && glXGetCurrentDrawable() == m_aGLWin.win;
glXGetCurrentDrawable() == nDrawable);
#endif #endif
} }
...@@ -1432,10 +1419,10 @@ void OpenGLContext::makeCurrent() ...@@ -1432,10 +1419,10 @@ void OpenGLContext::makeCurrent()
if (m_aGLWin.dpy) if (m_aGLWin.dpy)
{ {
GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win; if (!glXMakeCurrent( m_aGLWin.dpy, m_aGLWin.win, m_aGLWin.ctx ))
if (!glXMakeCurrent( m_aGLWin.dpy, nDrawable, 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; return;
} }
} }
...@@ -1497,7 +1484,7 @@ void OpenGLContext::swapBuffers() ...@@ -1497,7 +1484,7 @@ void OpenGLContext::swapBuffers()
#elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS) #elif defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS)
// nothing // nothing
#elif defined( UNX ) #elif defined( UNX )
glXSwapBuffers(m_aGLWin.dpy, mbPixmap ? m_aGLWin.glPix : m_aGLWin.win); glXSwapBuffers(m_aGLWin.dpy, m_aGLWin.win);
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment