Skip to content

Commit

Permalink
MythRenderOpenGL: Only check EGL display when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Jul 23, 2019
1 parent 44f3fb0 commit 55cb82b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions mythtv/libs/libmythui/libmythui.pro
Expand Up @@ -181,6 +181,14 @@ using_opengl {
using_opengles {
DEFINES += USING_OPENGLES
}
using_mmal {
LIBS += -lEGL
DEFINES += USING_MMAL
}
using_vaapi {
LIBS += -lEGL
DEFINES += USING_VAAPI
}
inc.files += mythpainter_ogl.h
mingw|win32-msvc*:LIBS += -lopengl32
}
Expand Down
9 changes: 8 additions & 1 deletion mythtv/libs/libmythui/mythrender_opengl.cpp
Expand Up @@ -21,7 +21,9 @@ using std::min;
#define LOC QString("OpenGL: ")

// Egl
#if defined (USING_MMAL) || defined (USING_VAAPI)
#include "EGL/egl.h"
#endif

#ifdef Q_OS_ANDROID
#include <android/log.h>
Expand Down Expand Up @@ -145,8 +147,10 @@ bool MythRenderOpenGL::IsEGL(void)
egl = true;
if (QGuiApplication::platformName().contains("xcb", Qt::CaseInsensitive))
egl |= qgetenv("QT_XCB_GL_INTEGRATION") == "xcb_egl";
#if defined (USING_MMAL) || defined (USING_VAAPI)
if (!egl)
egl = eglGetCurrentDisplay() != nullptr;
#endif
}
return egl;
}
Expand Down Expand Up @@ -386,7 +390,10 @@ void MythRenderOpenGL::DebugFeatures(void)
LOG(VB_GENERAL, LOG_INFO, LOC + QString("OpenGL vendor : %1").arg(reinterpret_cast<const char*>(glGetString(GL_VENDOR))));
LOG(VB_GENERAL, LOG_INFO, LOC + QString("OpenGL renderer : %1").arg(reinterpret_cast<const char*>(glGetString(GL_RENDERER))));
LOG(VB_GENERAL, LOG_INFO, LOC + QString("OpenGL version : %1").arg(reinterpret_cast<const char*>(glGetString(GL_VERSION))));
LOG(VB_GENERAL, LOG_INFO, LOC + QString("Qt platform : %1 (EGL: %2)").arg(QGuiApplication::platformName()).arg(GLYesNo(IsEGL())));
LOG(VB_GENERAL, LOG_INFO, LOC + QString("Qt platform : %1").arg(QGuiApplication::platformName()));
#if defined (USING_MMAL) || defined (USING_VAAPI)
LOG(VB_GENERAL, LOG_INFO, LOC + QString("EGL : %1").arg(GLYesNo(IsEGL())));
#endif
LOG(VB_GENERAL, LOG_INFO, LOC + QString("Qt OpenGL format : %1").arg(qtglversion));
LOG(VB_GENERAL, LOG_INFO, LOC + QString("Qt OpenGL surface : %1").arg(qtglsurface));
LOG(VB_GENERAL, LOG_INFO, LOC + QString("Max texture size : %1").arg(m_maxTextureSize));
Expand Down

0 comments on commit 55cb82b

Please sign in to comment.