From 1ce33cc65c062be273e6a1db34a79a4870dfaeea Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Wed, 30 Jan 2019 18:45:18 +0100 Subject: X11: remove not needed CGLContextEGL::IsSuitableVisual This calls GetEGLConfig which becomes also called direct after the place where IsSuitableVisual is called. --- xbmc/windowing/X11/GLContextEGL.cpp | 21 ++++----------------- xbmc/windowing/X11/GLContextEGL.h | 1 - 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/xbmc/windowing/X11/GLContextEGL.cpp b/xbmc/windowing/X11/GLContextEGL.cpp index 5a07916728..36ae4c0fb9 100644 --- a/xbmc/windowing/X11/GLContextEGL.cpp +++ b/xbmc/windowing/X11/GLContextEGL.cpp @@ -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(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) { @@ -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) diff --git a/xbmc/windowing/X11/GLContextEGL.h b/xbmc/windowing/X11/GLContextEGL.h index ba4431318b..a86c957109 100644 --- a/xbmc/windowing/X11/GLContextEGL.h +++ b/xbmc/windowing/X11/GLContextEGL.h @@ -34,7 +34,6 @@ public: 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; -- cgit v1.2.3