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
#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;
......
......@@ -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
}
......
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