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/plugins/platforms/openwfd/qopenwfdglcontext.cpp | 4 ++-- src/plugins/platforms/openwfd/qopenwfdglcontext.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/openwfd') 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: -- cgit v1.2.3