From 29d8159c4478a5275d2ea102daf270a91ed7e92e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 29 Jan 2016 10:43:35 +0100 Subject: Avoid repeated QByteArray creation when resolving opengl functions Add an getProcAddress(const char *) overload to QOpenGLContext, and refactor the QPA interface to take a const char *. Like this we can avoid lots of mallocs when resoving GL methods. Change-Id: Ic45b985fbaa0da8d32ba3e3b485351173352ca6f Reviewed-by: Laszlo Agocs Reviewed-by: Sean Harmer --- src/gui/kernel/qopenglcontext.cpp | 11 ++- src/gui/kernel/qopenglcontext.h | 1 + src/gui/kernel/qplatformopenglcontext.cpp | 5 +- src/gui/kernel/qplatformopenglcontext.h | 2 +- src/gui/opengl/qopengldebug.cpp | 2 +- src/gui/opengl/qopenglfunctions.cpp | 55 +++++++------ src/gui/opengl/qopengltexturehelper.cpp | 96 +++++++++++----------- src/gui/opengl/qopenglvertexarrayobject.cpp | 24 +++--- .../cglconvenience/cglconvenience.mm | 6 +- .../cglconvenience/cglconvenience_p.h | 2 +- .../eglconvenience/qeglplatformcontext.cpp | 4 +- .../eglconvenience/qeglplatformcontext_p.h | 2 +- src/plugins/platforms/cocoa/qcocoaglcontext.h | 2 +- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 2 +- .../platforms/directfb/qdirectfbglcontext.cpp | 4 +- src/plugins/platforms/ios/qioscontext.h | 2 +- src/plugins/platforms/ios/qioscontext.mm | 4 +- .../platforms/mirclient/qmirclientglcontext.cpp | 4 +- .../platforms/mirclient/qmirclientglcontext.h | 2 +- .../offscreen/qoffscreenintegration_x11.cpp | 4 +- .../offscreen/qoffscreenintegration_x11.h | 2 +- .../platforms/openwfd/qopenwfdglcontext.cpp | 4 +- src/plugins/platforms/openwfd/qopenwfdglcontext.h | 2 +- src/plugins/platforms/qnx/qqnxglcontext.cpp | 4 +- src/plugins/platforms/qnx/qqnxglcontext.h | 2 +- .../platforms/windows/qwindowseglcontext.cpp | 8 +- src/plugins/platforms/windows/qwindowseglcontext.h | 2 +- .../platforms/windows/qwindowsglcontext.cpp | 8 +- src/plugins/platforms/windows/qwindowsglcontext.h | 2 +- src/plugins/platforms/winrt/qwinrteglcontext.cpp | 4 +- src/plugins/platforms/winrt/qwinrteglcontext.h | 2 +- .../gl_integrations/xcb_glx/qglxintegration.cpp | 6 +- .../xcb/gl_integrations/xcb_glx/qglxintegration.h | 2 +- 33 files changed, 147 insertions(+), 135 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index b45396ab3c..f301b21ec1 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -1069,10 +1069,19 @@ void QOpenGLContext::swapBuffers(QSurface *surface) Returns 0 if no such function can be found. */ QFunctionPointer QOpenGLContext::getProcAddress(const QByteArray &procName) const +{ + return getProcAddress(procName.constData()); +} + +/*! + \overload + \since 5.8 + */ +QFunctionPointer QOpenGLContext::getProcAddress(const char *procName) const { Q_D(const QOpenGLContext); if (!d->platformGLContext) - return 0; + return nullptr; return d->platformGLContext->getProcAddress(procName); } diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index 56eb6f0e12..130d55464f 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -174,6 +174,7 @@ public: void swapBuffers(QSurface *surface); QFunctionPointer getProcAddress(const QByteArray &procName) const; + QFunctionPointer getProcAddress(const char *procName) const; QSurface *surface() const; diff --git a/src/gui/kernel/qplatformopenglcontext.cpp b/src/gui/kernel/qplatformopenglcontext.cpp index 2457a5237d..5b375f7883 100644 --- a/src/gui/kernel/qplatformopenglcontext.cpp +++ b/src/gui/kernel/qplatformopenglcontext.cpp @@ -71,10 +71,9 @@ QT_BEGIN_NAMESPACE The implementation must support being called in a thread different than the gui-thread. */ -/*! \fn QFunctionPointer QPlatformOpenGLContext::getProcAddress(const QByteArray &procName) - Reimplement in subclass to native getProcAddr calls. +/*! \fn QFunctionPointer QPlatformOpenGLContext::getProcAddress(const char *procName) - Note: its convenient to use qPrintable(const QString &str) to get the const char * pointer + Reimplement in subclass to native getProcAddr calls. */ class QPlatformOpenGLContextPrivate diff --git a/src/gui/kernel/qplatformopenglcontext.h b/src/gui/kernel/qplatformopenglcontext.h index f2ec1c1a7e..1a38a5fed3 100644 --- a/src/gui/kernel/qplatformopenglcontext.h +++ b/src/gui/kernel/qplatformopenglcontext.h @@ -83,7 +83,7 @@ public: virtual bool isSharing() const { return false; } virtual bool isValid() const { return true; } - virtual QFunctionPointer getProcAddress(const QByteArray &procName) = 0; + virtual QFunctionPointer getProcAddress(const char *procName) = 0; QOpenGLContext *context() const; diff --git a/src/gui/opengl/qopengldebug.cpp b/src/gui/opengl/qopengldebug.cpp index 5f0164c3e1..7bdf6ee443 100644 --- a/src/gui/opengl/qopengldebug.cpp +++ b/src/gui/opengl/qopengldebug.cpp @@ -1379,7 +1379,7 @@ bool QOpenGLDebugLogger::initialize() #define GET_DEBUG_PROC_ADDRESS(procName) \ d->procName = reinterpret_cast< qt_ ## procName ## _t >( \ - d->context->getProcAddress(QByteArrayLiteral( #procName )) \ + d->context->getProcAddress(#procName) \ ); GET_DEBUG_PROC_ADDRESS(glDebugMessageControl); diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index b7a82a5def..b77f2c4f0f 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -2199,36 +2199,39 @@ private: static QFunctionPointer getProcAddress(QOpenGLContext *context, const char *funcName, int policy) { - QByteArray fn = funcName; - int size = fn.size(); - QFunctionPointer function = context->getProcAddress(fn); - - // create room for the extension names - fn.resize(size + 5); - char *ext = fn.data() + size; - if (!function && (policy & ResolveOES)) { - memcpy(ext, "OES\0\0", 5); - function = context->getProcAddress(fn); - } + QFunctionPointer function = context->getProcAddress(funcName); + + if (!function && policy) { + char fn[512]; + size_t size = strlen(funcName); + Q_ASSERT(size < 500); + memcpy(fn, funcName, size); + + char *ext = fn + size; + if (!function && (policy & ResolveOES)) { + memcpy(ext, "OES", 4); + function = context->getProcAddress(fn); + } - if (!function) { - memcpy(ext, "ARB\0\0", 5); - function = context->getProcAddress(fn); - } + if (!function) { + memcpy(ext, "ARB", 4); + function = context->getProcAddress(fn); + } - if (!function && (policy & ResolveEXT)) { - memcpy(ext, "EXT\0\0", 5); - function = context->getProcAddress(fn); - } + if (!function && (policy & ResolveEXT)) { + memcpy(ext, "EXT", 4); + function = context->getProcAddress(fn); + } - if (!function && (policy & ResolveANGLE)) { - memcpy(ext, "ANGLE", 5); - function = context->getProcAddress(fn); - } + if (!function && (policy & ResolveANGLE)) { + memcpy(ext, "ANGLE", 6); + function = context->getProcAddress(fn); + } - if (!function && (policy & ResolveNV)) { - memcpy(ext, "NV\0\0\0", 5); - function = context->getProcAddress(fn); + if (!function && (policy & ResolveNV)) { + memcpy(ext, "NV", 3); + function = context->getProcAddress(fn); + } } return function; diff --git a/src/gui/opengl/qopengltexturehelper.cpp b/src/gui/opengl/qopengltexturehelper.cpp index afac873795..c0d3bc3c73 100644 --- a/src/gui/opengl/qopengltexturehelper.cpp +++ b/src/gui/opengl/qopengltexturehelper.cpp @@ -58,28 +58,28 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context) if (allowDSA && !context->isOpenGLES() && context->hasExtension(QByteArrayLiteral("GL_EXT_direct_state_access"))) { - TextureParameteriEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureParameteriEXT"))); - TextureParameterivEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureParameterivEXT"))); - TextureParameterfEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureParameterfEXT"))); - TextureParameterfvEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureParameterfvEXT"))); - GenerateTextureMipmapEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glGenerateTextureMipmapEXT"))); - TextureStorage3DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureStorage3DEXT"))); - TextureStorage2DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureStorage2DEXT"))); - TextureStorage1DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureStorage1DEXT"))); - TextureStorage3DMultisampleEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureStorage3DMultisampleEXT"))); - TextureStorage2DMultisampleEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureStorage2DMultisampleEXT"))); - TextureImage3DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureImage3DEXT"))); - TextureImage2DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureImage2DEXT"))); - TextureImage1DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureImage1DEXT"))); - TextureSubImage3DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureSubImage3DEXT"))); - TextureSubImage2DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureSubImage2DEXT"))); - TextureSubImage1DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureSubImage1DEXT"))); - CompressedTextureSubImage1DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTextureSubImage1DEXT"))); - CompressedTextureSubImage2DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTextureSubImage2DEXT"))); - CompressedTextureSubImage3DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTextureSubImage3DEXT"))); - CompressedTextureImage1DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTextureImage1DEXT"))); - CompressedTextureImage2DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTextureImage2DEXT"))); - CompressedTextureImage3DEXT = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTextureImage3DEXT"))); + TextureParameteriEXT = reinterpret_cast(context->getProcAddress("glTextureParameteriEXT")); + TextureParameterivEXT = reinterpret_cast(context->getProcAddress("glTextureParameterivEXT")); + TextureParameterfEXT = reinterpret_cast(context->getProcAddress("glTextureParameterfEXT")); + TextureParameterfvEXT = reinterpret_cast(context->getProcAddress("glTextureParameterfvEXT")); + GenerateTextureMipmapEXT = reinterpret_cast(context->getProcAddress("glGenerateTextureMipmapEXT")); + TextureStorage3DEXT = reinterpret_cast(context->getProcAddress("glTextureStorage3DEXT")); + TextureStorage2DEXT = reinterpret_cast(context->getProcAddress("glTextureStorage2DEXT")); + TextureStorage1DEXT = reinterpret_cast(context->getProcAddress("glTextureStorage1DEXT")); + TextureStorage3DMultisampleEXT = reinterpret_cast(context->getProcAddress("glTextureStorage3DMultisampleEXT")); + TextureStorage2DMultisampleEXT = reinterpret_cast(context->getProcAddress("glTextureStorage2DMultisampleEXT")); + TextureImage3DEXT = reinterpret_cast(context->getProcAddress("glTextureImage3DEXT")); + TextureImage2DEXT = reinterpret_cast(context->getProcAddress("glTextureImage2DEXT")); + TextureImage1DEXT = reinterpret_cast(context->getProcAddress("glTextureImage1DEXT")); + TextureSubImage3DEXT = reinterpret_cast(context->getProcAddress("glTextureSubImage3DEXT")); + TextureSubImage2DEXT = reinterpret_cast(context->getProcAddress("glTextureSubImage2DEXT")); + TextureSubImage1DEXT = reinterpret_cast(context->getProcAddress("glTextureSubImage1DEXT")); + CompressedTextureSubImage1DEXT = reinterpret_cast(context->getProcAddress("glCompressedTextureSubImage1DEXT")); + CompressedTextureSubImage2DEXT = reinterpret_cast(context->getProcAddress("glCompressedTextureSubImage2DEXT")); + CompressedTextureSubImage3DEXT = reinterpret_cast(context->getProcAddress("glCompressedTextureSubImage3DEXT")); + CompressedTextureImage1DEXT = reinterpret_cast(context->getProcAddress("glCompressedTextureImage1DEXT")); + CompressedTextureImage2DEXT = reinterpret_cast(context->getProcAddress("glCompressedTextureImage2DEXT")); + CompressedTextureImage3DEXT = reinterpret_cast(context->getProcAddress("glCompressedTextureImage3DEXT")); // Use the real DSA functions TextureParameteri = &QOpenGLTextureHelper::dsa_TextureParameteri; @@ -133,8 +133,8 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context) // Some DSA functions are part of NV_texture_multisample instead if (!context->isOpenGLES() && context->hasExtension(QByteArrayLiteral("GL_NV_texture_multisample"))) { - TextureImage3DMultisampleNV = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureImage3DMultisampleNV"))); - TextureImage2DMultisampleNV = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureImage2DMultisampleNV"))); + TextureImage3DMultisampleNV = reinterpret_cast(context->getProcAddress("glTextureImage3DMultisampleNV")); + TextureImage2DMultisampleNV = reinterpret_cast(context->getProcAddress("glTextureImage2DMultisampleNV")); TextureImage3DMultisample = &QOpenGLTextureHelper::dsa_TextureImage3DMultisample; TextureImage2DMultisample = &QOpenGLTextureHelper::dsa_TextureImage2DMultisample; @@ -202,10 +202,10 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context) #endif if (context->isOpenGLES() && context->hasExtension(QByteArrayLiteral("GL_OES_texture_3D"))) { - TexImage3D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexImage3DOES"))); - TexSubImage3D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexSubImage3DOES"))); - CompressedTexImage3D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTexImage3DOES"))); - CompressedTexSubImage3D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTexSubImage3DOES"))); + TexImage3D = reinterpret_cast(context->getProcAddress("glTexImage3DOES")); + TexSubImage3D = reinterpret_cast(context->getProcAddress("glTexSubImage3DOES")); + CompressedTexImage3D = reinterpret_cast(context->getProcAddress("glCompressedTexImage3DOES")); + CompressedTexSubImage3D = reinterpret_cast(context->getProcAddress("glCompressedTexSubImage3DOES")); } else { QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (ctx->isOpenGLES() && ctx->format().majorVersion() >= 3) { @@ -217,41 +217,41 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context) CompressedTexSubImage3D = es3->CompressedTexSubImage3D; } else { // OpenGL 1.2 - TexImage3D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexImage3D"))); - TexSubImage3D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexSubImage3D"))); + TexImage3D = reinterpret_cast(context->getProcAddress("glTexImage3D")); + TexSubImage3D = reinterpret_cast(context->getProcAddress("glTexSubImage3D")); // OpenGL 1.3 - CompressedTexImage3D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTexImage3D"))); - CompressedTexSubImage3D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTexSubImage3D"))); + CompressedTexImage3D = reinterpret_cast(context->getProcAddress("glCompressedTexImage3D")); + CompressedTexSubImage3D = reinterpret_cast(context->getProcAddress("glCompressedTexSubImage3D")); } } #ifndef QT_OPENGL_ES_2 // OpenGL 1.3 - GetCompressedTexImage = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glGetCompressedTexImage"))); - CompressedTexSubImage1D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTexSubImage1D"))); - CompressedTexSubImage2D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTexSubImage2D"))); - CompressedTexImage1D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTexImage1D"))); - CompressedTexImage2D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glCompressedTexImage2D"))); - ActiveTexture = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glActiveTexture"))); + GetCompressedTexImage = reinterpret_cast(context->getProcAddress("glGetCompressedTexImage")); + CompressedTexSubImage1D = reinterpret_cast(context->getProcAddress("glCompressedTexSubImage1D")); + CompressedTexSubImage2D = reinterpret_cast(context->getProcAddress("glCompressedTexSubImage2D")); + CompressedTexImage1D = reinterpret_cast(context->getProcAddress("glCompressedTexImage1D")); + CompressedTexImage2D = reinterpret_cast(context->getProcAddress("glCompressedTexImage2D")); + ActiveTexture = reinterpret_cast(context->getProcAddress("glActiveTexture")); // OpenGL 3.0 - GenerateMipmap = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glGenerateMipmap"))); + GenerateMipmap = reinterpret_cast(context->getProcAddress("glGenerateMipmap")); // OpenGL 3.2 - TexImage3DMultisample = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexImage3DMultisample"))); - TexImage2DMultisample = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexImage2DMultisample"))); + TexImage3DMultisample = reinterpret_cast(context->getProcAddress("glTexImage3DMultisample")); + TexImage2DMultisample = reinterpret_cast(context->getProcAddress("glTexImage2DMultisample")); // OpenGL 4.2 - TexStorage3D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexStorage3D"))); - TexStorage2D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexStorage2D"))); - TexStorage1D = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexStorage1D"))); + TexStorage3D = reinterpret_cast(context->getProcAddress("glTexStorage3D")); + TexStorage2D = reinterpret_cast(context->getProcAddress("glTexStorage2D")); + TexStorage1D = reinterpret_cast(context->getProcAddress("glTexStorage1D")); // OpenGL 4.3 - TexStorage3DMultisample = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexStorage3DMultisample"))); - TexStorage2DMultisample = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexStorage2DMultisample"))); - TexBufferRange = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTexBufferRange"))); - TextureView = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glTextureView"))); + TexStorage3DMultisample = reinterpret_cast(context->getProcAddress("glTexStorage3DMultisample")); + TexStorage2DMultisample = reinterpret_cast(context->getProcAddress("glTexStorage2DMultisample")); + TexBufferRange = reinterpret_cast(context->getProcAddress("glTexBufferRange")); + TextureView = reinterpret_cast(context->getProcAddress("glTextureView")); #endif } diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp index 8e0b536909..fe1e308532 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.cpp +++ b/src/gui/opengl/qopenglvertexarrayobject.cpp @@ -70,26 +70,26 @@ void qtInitializeVertexArrayObjectHelper(QOpenGLVertexArrayObjectHelper *helper, helper->IsVertexArray = es3->IsVertexArray; tryARB = false; } else if (context->hasExtension(QByteArrayLiteral("GL_OES_vertex_array_object"))) { - helper->GenVertexArrays = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glGenVertexArraysOES"))); - helper->DeleteVertexArrays = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glDeleteVertexArraysOES"))); - helper->BindVertexArray = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glBindVertexArrayOES"))); - helper->IsVertexArray = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glIsVertexArrayOES"))); + helper->GenVertexArrays = reinterpret_cast(context->getProcAddress("glGenVertexArraysOES")); + helper->DeleteVertexArrays = reinterpret_cast(context->getProcAddress("glDeleteVertexArraysOES")); + helper->BindVertexArray = reinterpret_cast(context->getProcAddress("glBindVertexArrayOES")); + helper->IsVertexArray = reinterpret_cast(context->getProcAddress("glIsVertexArrayOES")); tryARB = false; } } else if (context->hasExtension(QByteArrayLiteral("GL_APPLE_vertex_array_object")) && !context->hasExtension(QByteArrayLiteral("GL_ARB_vertex_array_object"))) { - helper->GenVertexArrays = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glGenVertexArraysAPPLE"))); - helper->DeleteVertexArrays = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glDeleteVertexArraysAPPLE"))); - helper->BindVertexArray = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glBindVertexArrayAPPLE"))); - helper->IsVertexArray = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glIsVertexArrayAPPLE"))); + helper->GenVertexArrays = reinterpret_cast(context->getProcAddress("glGenVertexArraysAPPLE")); + helper->DeleteVertexArrays = reinterpret_cast(context->getProcAddress("glDeleteVertexArraysAPPLE")); + helper->BindVertexArray = reinterpret_cast(context->getProcAddress("glBindVertexArrayAPPLE")); + helper->IsVertexArray = reinterpret_cast(context->getProcAddress("glIsVertexArrayAPPLE")); tryARB = false; } if (tryARB && context->hasExtension(QByteArrayLiteral("GL_ARB_vertex_array_object"))) { - helper->GenVertexArrays = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glGenVertexArrays"))); - helper->DeleteVertexArrays = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glDeleteVertexArrays"))); - helper->BindVertexArray = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glBindVertexArray"))); - helper->IsVertexArray = reinterpret_cast(context->getProcAddress(QByteArrayLiteral("glIsVertexArray"))); + helper->GenVertexArrays = reinterpret_cast(context->getProcAddress("glGenVertexArrays")); + helper->DeleteVertexArrays = reinterpret_cast(context->getProcAddress("glDeleteVertexArrays")); + helper->BindVertexArray = reinterpret_cast(context->getProcAddress("glBindVertexArray")); + helper->IsVertexArray = reinterpret_cast(context->getProcAddress("glIsVertexArray")); } } diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm index aafd4db863..051b299404 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.mm +++ b/src/platformsupport/cglconvenience/cglconvenience.mm @@ -43,17 +43,17 @@ #include #include -void (*qcgl_getProcAddress(const QByteArray &procName))() +QFunctionPointer qcgl_getProcAddress(const char *procName) { CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/System/Library/Frameworks/OpenGL.framework"), kCFURLPOSIXPathStyle, false); CFBundleRef bundle = CFBundleCreate(kCFAllocatorDefault, url); - CFStringRef procNameCF = QCFString::toCFStringRef(QString::fromLatin1(procName.constData())); + CFStringRef procNameCF = QCFString::toCFStringRef(QString::fromLatin1(procName)); void *proc = CFBundleGetFunctionPointerForName(bundle, procNameCF); CFRelease(url); CFRelease(bundle); CFRelease(procNameCF); - return (void (*) ())proc; + return (QFunctionPointer)proc; } // Match up with createNSOpenGLPixelFormat below! diff --git a/src/platformsupport/cglconvenience/cglconvenience_p.h b/src/platformsupport/cglconvenience/cglconvenience_p.h index cb0820263a..adc1879916 100644 --- a/src/platformsupport/cglconvenience/cglconvenience_p.h +++ b/src/platformsupport/cglconvenience/cglconvenience_p.h @@ -55,7 +55,7 @@ #include #include -void (*qcgl_getProcAddress(const QByteArray &procName))(); +QFunctionPointer qcgl_getProcAddress(const char *procName); QSurfaceFormat qcgl_surfaceFormat(); void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format); diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 9e7298b89a..e4cfb86ab3 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -440,10 +440,10 @@ void QEGLPlatformContext::swapBuffers(QPlatformSurface *surface) } } -void (*QEGLPlatformContext::getProcAddress(const QByteArray &procName)) () +QFunctionPointer QEGLPlatformContext::getProcAddress(const char *procName) { eglBindAPI(m_api); - return eglGetProcAddress(procName.constData()); + return eglGetProcAddress(procName); } QSurfaceFormat QEGLPlatformContext::format() const diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h index 2679c3b9f8..e772f5df89 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h @@ -76,7 +76,7 @@ public: bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE; void doneCurrent() Q_DECL_OVERRIDE; void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; QSurfaceFormat format() const Q_DECL_OVERRIDE; bool isSharing() const Q_DECL_OVERRIDE { return m_shareContext != EGL_NO_CONTEXT; } diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h index cca541e0e3..5bee708b76 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.h +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h @@ -63,7 +63,7 @@ public: bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE; void doneCurrent() Q_DECL_OVERRIDE; - void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; void update(); diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index e4712d88bc..c004f26d02 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -335,7 +335,7 @@ void QCocoaGLContext::doneCurrent() [NSOpenGLContext clearCurrentContext]; } -void (*QCocoaGLContext::getProcAddress(const QByteArray &procName))() +QFunctionPointer QCocoaGLContext::getProcAddress(const char *procName) { return qcgl_getProcAddress(procName); } diff --git a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp index 1136591c78..e1607b131a 100644 --- a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp +++ b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp @@ -80,10 +80,10 @@ void QDirectFbGLContext::doneCurrent() m_dfbGlContext->Unlock(m_dfbGlContext); } -void *QDirectFbGLContext::getProcAddress(const QString &procName) +void *QDirectFbGLContext::getProcAddress(const char *procName) { void *proc; - DFBResult result = m_dfbGlContext->GetProcAddress(m_dfbGlContext,qPrintable(procName),&proc); + DFBResult result = m_dfbGlContext->GetProcAddress(m_dfbGlContext, procName, &proc); if (result == DFB_OK) return proc; return 0; diff --git a/src/plugins/platforms/ios/qioscontext.h b/src/plugins/platforms/ios/qioscontext.h index 53ef1d7b54..c8a4fae20c 100644 --- a/src/plugins/platforms/ios/qioscontext.h +++ b/src/plugins/platforms/ios/qioscontext.h @@ -64,7 +64,7 @@ public: void doneCurrent() Q_DECL_OVERRIDE; GLuint defaultFramebufferObject(QPlatformSurface *) const Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; bool isSharing() const Q_DECL_OVERRIDE; bool isValid() const Q_DECL_OVERRIDE; diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index b7ca88b9ee..546b003d14 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -266,9 +266,9 @@ void QIOSContext::windowDestroyed(QObject *object) } } -QFunctionPointer QIOSContext::getProcAddress(const QByteArray& functionName) +QFunctionPointer QIOSContext::getProcAddress(const char *functionName) { - return QFunctionPointer(dlsym(RTLD_DEFAULT, functionName.constData())); + return QFunctionPointer(dlsym(RTLD_DEFAULT, functionName)); } bool QIOSContext::isValid() const diff --git a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp index e1e7727486..7a288af6ff 100644 --- a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp +++ b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp @@ -143,12 +143,12 @@ void QMirClientOpenGLContext::swapBuffers(QPlatformSurface* surface) ubuntuWindow->onSwapBuffersDone(); } -void (*QMirClientOpenGLContext::getProcAddress(const QByteArray& procName)) () +QFunctionPointer QMirClientOpenGLContext::getProcAddress(const char *procName) { #if defined(QT_NO_DEBUG) eglBindAPI(api_in_use()); #else ASSERT(eglBindAPI(api_in_use()) == EGL_TRUE); #endif - return eglGetProcAddress(procName.constData()); + return eglGetProcAddress(procName); } diff --git a/src/plugins/platforms/mirclient/qmirclientglcontext.h b/src/plugins/platforms/mirclient/qmirclientglcontext.h index 29c196ce5c..9278cc7beb 100644 --- a/src/plugins/platforms/mirclient/qmirclientglcontext.h +++ b/src/plugins/platforms/mirclient/qmirclientglcontext.h @@ -53,7 +53,7 @@ public: bool makeCurrent(QPlatformSurface* surface) override; void doneCurrent() override; bool isValid() const override { return mEglContext != EGL_NO_CONTEXT; } - void (*getProcAddress(const QByteArray& procName)) () override; + QFunctionPointer getProcAddress(const char *procName) override; EGLContext eglContext() const { return mEglContext; } diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp index bec7fc9c96..2187eceed4 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp @@ -227,9 +227,9 @@ void QOffscreenX11GLXContext::swapBuffers(QPlatformSurface *) { } -void (*QOffscreenX11GLXContext::getProcAddress(const QByteArray &procName)) () +QFunctionPointer QOffscreenX11GLXContext::getProcAddress(const char *procName) { - return (void (*)())glXGetProcAddressARB(reinterpret_cast(procName.constData())); + return (QFunctionPointer)glXGetProcAddressARB(reinterpret_cast(procName)); } QSurfaceFormat QOffscreenX11GLXContext::format() const diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h index a19ded7c11..aaca74d2fb 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h +++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h @@ -91,7 +91,7 @@ public: bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE; void doneCurrent() Q_DECL_OVERRIDE; void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; QSurfaceFormat format() const Q_DECL_OVERRIDE; bool isSharing() const Q_DECL_OVERRIDE; diff --git a/src/plugins/platforms/openwfd/qopenwfdglcontext.cpp b/src/plugins/platforms/openwfd/qopenwfdglcontext.cpp index d76c56db65..e57be90870 100644 --- a/src/plugins/platforms/openwfd/qopenwfdglcontext.cpp +++ b/src/plugins/platforms/openwfd/qopenwfdglcontext.cpp @@ -84,9 +84,9 @@ void QOpenWFDGLContext::swapBuffers(QPlatformSurface *surface) screen->swapBuffers(); } -void (*QOpenWFDGLContext::getProcAddress(const QByteArray &procName)) () +QFunctionPointer QOpenWFDGLContext::getProcAddress(const char *procName) { - return eglGetProcAddress(procName.data()); + return eglGetProcAddress(procName); } EGLContext QOpenWFDGLContext::eglContext() const diff --git a/src/plugins/platforms/openwfd/qopenwfdglcontext.h b/src/plugins/platforms/openwfd/qopenwfdglcontext.h index 7b5a003253..1c2541e098 100644 --- a/src/plugins/platforms/openwfd/qopenwfdglcontext.h +++ b/src/plugins/platforms/openwfd/qopenwfdglcontext.h @@ -56,7 +56,7 @@ public: void swapBuffers(QPlatformSurface *surface); - void (*getProcAddress(const QByteArray &procName)) (); + QFunctionPointer getProcAddress(const char *procName); EGLContext eglContext() const; private: diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index 8207de4cbe..0d3076a743 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -252,7 +252,7 @@ void QQnxGLContext::swapBuffers(QPlatformSurface *surface) platformWindow->swapEGLBuffers(); } -QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName) +QFunctionPointer QQnxGLContext::getProcAddress(const char *procName) { qGLContextDebug(); @@ -262,7 +262,7 @@ QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName) qFatal("QQNX: failed to set EGL API, err=%d", eglGetError()); // Lookup EGL extension function pointer - return static_cast(eglGetProcAddress(procName.constData())); + return static_cast(eglGetProcAddress(procName)); } bool QQnxGLContext::isSharing() const diff --git a/src/plugins/platforms/qnx/qqnxglcontext.h b/src/plugins/platforms/qnx/qqnxglcontext.h index 897dbefc38..74cd3b4c48 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.h +++ b/src/plugins/platforms/qnx/qqnxglcontext.h @@ -67,7 +67,7 @@ public: bool makeCurrent(QPlatformSurface *surface); void doneCurrent(); void swapBuffers(QPlatformSurface *surface); - QFunctionPointer getProcAddress(const QByteArray &procName); + QFunctionPointer getProcAddress(const char *procName); virtual QSurfaceFormat format() const { return m_windowFormat; } bool isSharing() const; diff --git a/src/plugins/platforms/windows/qwindowseglcontext.cpp b/src/plugins/platforms/windows/qwindowseglcontext.cpp index a11196d1d2..253fa1d217 100644 --- a/src/plugins/platforms/windows/qwindowseglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowseglcontext.cpp @@ -683,7 +683,7 @@ void QWindowsEGLContext::swapBuffers(QPlatformSurface *surface) } } -QFunctionPointer QWindowsEGLContext::getProcAddress(const QByteArray &procName) +QFunctionPointer QWindowsEGLContext::getProcAddress(const char *procName) { // We support AllGLFunctionsQueryable, which means this function must be able to // return a function pointer for standard GLES2 functions too. These are not @@ -838,15 +838,15 @@ QFunctionPointer QWindowsEGLContext::getProcAddress(const QByteArray &procName) { "glDepthRangef", (void *) QWindowsEGLStaticContext::libGLESv2.glDepthRangef } }; for (size_t i = 0; i < sizeof(standardFuncs) / sizeof(StdFunc); ++i) - if (procName == standardFuncs[i].name) + if (!qstrcmp(procName, standardFuncs[i].name)) return reinterpret_cast(standardFuncs[i].func); QWindowsEGLStaticContext::libEGL.eglBindAPI(m_api); - QFunctionPointer procAddress = reinterpret_cast(QWindowsEGLStaticContext::libEGL.eglGetProcAddress(procName.constData())); + QFunctionPointer procAddress = reinterpret_cast(QWindowsEGLStaticContext::libEGL.eglGetProcAddress(procName)); if (QWindowsContext::verbose > 1) qCDebug(lcQpaGl) << __FUNCTION__ << procName << QWindowsEGLStaticContext::libEGL.eglGetCurrentContext() << "returns" << procAddress; if (!procAddress && QWindowsContext::verbose) - qWarning("%s: Unable to resolve '%s'", __FUNCTION__, procName.constData()); + qWarning("%s: Unable to resolve '%s'", __FUNCTION__, procName); return procAddress; } diff --git a/src/plugins/platforms/windows/qwindowseglcontext.h b/src/plugins/platforms/windows/qwindowseglcontext.h index ccc2cdcad1..e49d1da9c5 100644 --- a/src/plugins/platforms/windows/qwindowseglcontext.h +++ b/src/plugins/platforms/windows/qwindowseglcontext.h @@ -292,7 +292,7 @@ public: bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE; void doneCurrent() Q_DECL_OVERRIDE; void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; } bool isSharing() const Q_DECL_OVERRIDE { return m_shareContext != EGL_NO_CONTEXT; } diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index 48f2e3aaef..8eac7cca9e 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -1381,7 +1381,7 @@ void QWindowsGLContext::doneCurrent() releaseDCs(); } -QFunctionPointer QWindowsGLContext::getProcAddress(const QByteArray &procName) +QFunctionPointer QWindowsGLContext::getProcAddress(const char *procName) { // We support AllGLFunctionsQueryable, which means this function must be able to // return a function pointer even for functions that are in GL.h and exported @@ -1444,17 +1444,17 @@ QFunctionPointer QWindowsGLContext::getProcAddress(const QByteArray &procName) { "glDepthRange", (void *) QOpenGLStaticContext::opengl32.glDepthRange }, }; for (size_t i = 0; i < sizeof(standardFuncs) / sizeof(StdFunc); ++i) - if (procName == standardFuncs[i].name) + if (!qstrcmp(procName, standardFuncs[i].name)) return reinterpret_cast(standardFuncs[i].func); // Even though we use QFunctionPointer, it does not mean the function can be called. // It will need to be cast to the proper function type with the correct calling // convention. QFunctionPointer is nothing more than a glorified void* here. - QFunctionPointer procAddress = reinterpret_cast(QOpenGLStaticContext::opengl32.wglGetProcAddress(procName.constData())); + QFunctionPointer procAddress = reinterpret_cast(QOpenGLStaticContext::opengl32.wglGetProcAddress(procName)); if (QWindowsContext::verbose > 1) qCDebug(lcQpaGl) << __FUNCTION__ << procName << QOpenGLStaticContext::opengl32.wglGetCurrentContext() << "returns" << procAddress; if (!procAddress && QWindowsContext::verbose) - qWarning("%s: Unable to resolve '%s'", __FUNCTION__, procName.constData()); + qWarning("%s: Unable to resolve '%s'", __FUNCTION__, procName); return procAddress; } diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h index 3acfed1ccf..a0fc31227e 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.h +++ b/src/plugins/platforms/windows/qwindowsglcontext.h @@ -251,7 +251,7 @@ public: typedef void (*GL_Proc) (); - QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; HGLRC renderingContext() const { return m_renderingContext; } diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.cpp b/src/plugins/platforms/winrt/qwinrteglcontext.cpp index 34f439b70f..dfc9e31f14 100644 --- a/src/plugins/platforms/winrt/qwinrteglcontext.cpp +++ b/src/plugins/platforms/winrt/qwinrteglcontext.cpp @@ -195,7 +195,7 @@ QSurfaceFormat QWinRTEGLContext::format() const return d->format; } -QFunctionPointer QWinRTEGLContext::getProcAddress(const QByteArray &procName) +QFunctionPointer QWinRTEGLContext::getProcAddress(const char *procName) { static QHash standardFuncs; if (standardFuncs.isEmpty()) { @@ -347,7 +347,7 @@ QFunctionPointer QWinRTEGLContext::getProcAddress(const QByteArray &procName) if (i != standardFuncs.end()) return i.value(); - return eglGetProcAddress(procName.constData()); + return eglGetProcAddress(procName); } EGLDisplay QWinRTEGLContext::display() diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.h b/src/plugins/platforms/winrt/qwinrteglcontext.h index 49b289cd79..6f38e2535d 100644 --- a/src/plugins/platforms/winrt/qwinrteglcontext.h +++ b/src/plugins/platforms/winrt/qwinrteglcontext.h @@ -56,7 +56,7 @@ public: void swapBuffers(QPlatformSurface *windowSurface) Q_DECL_OVERRIDE; QSurfaceFormat format() const Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; static EGLDisplay display(); private: diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index ff624d9755..4290ec54fc 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -550,10 +550,10 @@ void QGLXContext::swapBuffers(QPlatformSurface *surface) } } -void (*QGLXContext::getProcAddress(const QByteArray &procName)) () +QFunctionPointer QGLXContext::getProcAddress(const char *procName) { #ifdef QT_STATIC - return glXGetProcAddressARB(reinterpret_cast(procName.constData())); + return glXGetProcAddressARB(reinterpret_cast(procName)); #else typedef void *(*qt_glXGetProcAddressARB)(const GLubyte *); static qt_glXGetProcAddressARB glXGetProcAddressARB = 0; @@ -585,7 +585,7 @@ void (*QGLXContext::getProcAddress(const QByteArray &procName)) () } if (!glXGetProcAddressARB) return 0; - return (void (*)())glXGetProcAddressARB(reinterpret_cast(procName.constData())); + return (void (*)())glXGetProcAddressARB(reinterpret_cast(procName)); #endif } diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h index e5cbee3363..f00d96e6d5 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h @@ -63,7 +63,7 @@ public: bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE; void doneCurrent() Q_DECL_OVERRIDE; void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; QSurfaceFormat format() const Q_DECL_OVERRIDE; bool isSharing() const Q_DECL_OVERRIDE; -- cgit v1.2.3