Skip to content

Commit

Permalink
X11: remove not needed CGLContextEGL::IsSuitableVisual
Browse files Browse the repository at this point in the history
This calls GetEGLConfig which becomes also called direct after
the place where IsSuitableVisual is called.
  • Loading branch information
AlwinEsch committed Feb 8, 2019
1 parent e393a31 commit 1ce33cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
21 changes: 4 additions & 17 deletions xbmc/windowing/X11/GLContextEGL.cpp
Expand Up @@ -129,26 +129,19 @@ bool CGLContextEGL::Refresh(bool force, int screen, Window glWindow, bool &newCo
return false;
}

if (!IsSuitableVisual(vInfo))
{
CLog::Log(LOGWARNING, "Visual 0x%x of the window is not suitable", (unsigned) vInfo->visualid);
XFree(vInfo);
Destroy();
return false;
}

CLog::Log(LOGNOTICE, "Using visual 0x%x", (unsigned) vInfo->visualid);

unsigned int visualid = static_cast<unsigned int>(vInfo->visualid);
m_eglConfig = GetEGLConfig(m_eglDisplay, vInfo);
XFree(vInfo);

if (m_eglConfig == EGL_NO_CONFIG)
{
CLog::Log(LOGERROR, "failed to get eglconfig for visual id");
CLog::Log(LOGERROR, "failed to get suitable eglconfig for visual 0x%x", visualid);
Destroy();
return false;
}

CLog::Log(LOGNOTICE, "Using visual 0x%x", visualid);

m_eglSurface = eglCreateWindowSurface(m_eglDisplay, m_eglConfig, glWindow, NULL);
if (m_eglSurface == EGL_NO_SURFACE)
{
Expand Down Expand Up @@ -332,12 +325,6 @@ void CGLContextEGL::Detach()
}
}

bool CGLContextEGL::IsSuitableVisual(XVisualInfo *vInfo)
{
EGLConfig config = GetEGLConfig(m_eglDisplay, vInfo);
return config != EGL_NO_CONFIG;
}

bool CGLContextEGL::SuitableCheck(EGLDisplay eglDisplay, EGLConfig config)
{
if (config == EGL_NO_CONFIG)
Expand Down
1 change: 0 additions & 1 deletion xbmc/windowing/X11/GLContextEGL.h
Expand Up @@ -34,7 +34,6 @@ class CGLContextEGL : public CGLContext
EGLContext m_eglContext;
EGLConfig m_eglConfig;
protected:
bool IsSuitableVisual(XVisualInfo *vInfo);
bool SuitableCheck(EGLDisplay eglDisplay, EGLConfig config);
EGLConfig GetEGLConfig(EGLDisplay eglDisplay, XVisualInfo *vInfo);
PFNEGLGETSYNCVALUESCHROMIUMPROC eglGetSyncValuesCHROMIUM = nullptr;
Expand Down

0 comments on commit 1ce33cc

Please sign in to comment.