summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/openwfd
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2016-01-29 10:43:35 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-03-01 14:46:14 +0000
commit29d8159c4478a5275d2ea102daf270a91ed7e92e (patch)
tree709a145107cdfc58e67b4fabe6a76534d5cc7801 /src/plugins/platforms/openwfd
parent7ee585bbffb4350ec327116d30cd63e3d1142581 (diff)
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 <laszlo.agocs@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/plugins/platforms/openwfd')
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdglcontext.cpp4
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdglcontext.h2
2 files changed, 3 insertions, 3 deletions
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: