[kwinglutils] Drop hasEGLVersion function

Summary:
It's unused in KWin and absolutely not needed as the call to
eglInitialize, which every platform does, also gives the version for
free. So no need to do any caching in a global method.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3390
This commit is contained in:
Martin Gräßlin 2016-11-16 18:44:17 +01:00
parent fd83366e31
commit 5d3e15ff3a
2 changed files with 0 additions and 12 deletions

View file

@ -60,8 +60,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace KWin
{
// Variables
// EGL version, use MAKE_GL_VERSION() macro for comparing with a specific version
static int eglVersion;
// List of all supported GL, EGL and GLX extensions
static QList<QByteArray> glExtensions;
static QList<QByteArray> s_eglExtensions;
@ -76,9 +74,6 @@ void initEGL()
EGLDisplay dpy = eglGetCurrentDisplay();
if (dpy == EGL_NO_DISPLAY)
dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
int major, minor;
eglInitialize(dpy, &major, &minor);
eglVersion = MAKE_GL_VERSION(major, minor, 0);
const QByteArray string = eglQueryString(dpy, EGL_EXTENSIONS);
s_eglExtensions = string.split(' ');
eglResolveFunctions();
@ -117,7 +112,6 @@ void cleanupGL()
glExtensions.clear();
s_eglExtensions.clear();
eglVersion = 0;
glTextureUnitsCount = 0;
}
@ -126,11 +120,6 @@ bool hasGLVersion(int major, int minor, int release)
return GLPlatform::instance()->glVersion() >= kVersionNumber(major, minor, release);
}
bool hasEGLVersion(int major, int minor, int release)
{
return eglVersion >= MAKE_GL_VERSION(major, minor, release);
}
bool hasGLExtension(const QByteArray &extension)
{
return glExtensions.contains(extension) || s_eglExtensions.contains(extension);

View file

@ -63,7 +63,6 @@ extern KWINGLUTILS_EXPORT int glTextureUnitsCount;
bool KWINGLUTILS_EXPORT hasGLVersion(int major, int minor, int release = 0);
bool KWINGLUTILS_EXPORT hasEGLVersion(int major, int minor, int release = 0);
// use for both OpenGL and GLX extensions
bool KWINGLUTILS_EXPORT hasGLExtension(const QByteArray &extension);