diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-10-24 16:35:32 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-10-24 16:35:32 +0200 |
commit | de6e5170aa20eb17d174086b9784f0bf0a788305 (patch) | |
tree | 4976f390e75f0fb97e2429d6c5b33b13c4767d92 | |
parent | 4eaef1717266419880d9b3814215291adf6b931f (diff) |
reduce one use of SystemWinData
Change-Id: I777a8e324864ab9eab2a3df3e0645910dd1478a4
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 79430ba5a78e..0d7faffdc049 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -369,15 +369,11 @@ int oglErrorHandler( Display* /*dpy*/, XErrorEvent* /*evnt*/ ) return 0; } -GLXFBConfig* getFBConfig(const SystemEnvData* sysData, int& nBestFBC) +GLXFBConfig* getFBConfig(Display* dpy, Window win, int& nBestFBC) { - Display *dpy = reinterpret_cast<Display*>(sysData->pDisplay); - if( dpy == 0 || !glXQueryExtension( dpy, NULL, NULL ) ) return NULL; - Window win = sysData->aWindow; - SAL_INFO("vcl.opengl", "parent window: " << win); XWindowAttributes xattr; @@ -490,8 +486,7 @@ bool OpenGLContext::ImplInit() if (glXCreateContextAttribsARB && !mbRequestLegacyContext) { int best_fbc = -1; - const SystemEnvData* sysData(m_pChildWindow->GetSystemData()); - GLXFBConfig* pFBC = getFBConfig(sysData, best_fbc); + GLXFBConfig* pFBC = getFBConfig(m_aGLWin.dpy, m_aGLWin.win, best_fbc); if (!pFBC) return false; @@ -851,6 +846,7 @@ SystemWindowData OpenGLContext::generateWinData(vcl::Window* pParent, bool) const SystemEnvData* sysData(pParent->GetSystemData()); Display *dpy = reinterpret_cast<Display*>(sysData->pDisplay); + Window win = sysData->aWindow; if( dpy == 0 || !glXQueryExtension( dpy, NULL, NULL ) ) return aWinData; @@ -858,7 +854,7 @@ SystemWindowData OpenGLContext::generateWinData(vcl::Window* pParent, bool) initOpenGLFunctionPointers(); int best_fbc = -1; - GLXFBConfig* pFBC = getFBConfig(sysData, best_fbc); + GLXFBConfig* pFBC = getFBConfig(dpy, win, best_fbc); XVisualInfo* vi = glXGetVisualFromFBConfig( dpy, pFBC[best_fbc] ); if( vi ) |