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/offscreen/qoffscreenintegration_x11.cpp | 4 ++-- src/plugins/platforms/offscreen/qoffscreenintegration_x11.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/offscreen') 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; -- cgit v1.2.3 From a28364bc1c7144b9c5c383cc5d18d62a68076a38 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 12 Feb 2016 16:03:42 +0100 Subject: consistently put {qt,qml}_{module,plugin} at the end of project files this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: Icbce502dcbcb4d4b4d922c42679f44e2cc930bf3 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/offscreen/offscreen.pro | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/offscreen') diff --git a/src/plugins/platforms/offscreen/offscreen.pro b/src/plugins/platforms/offscreen/offscreen.pro index 94eeac6acc..999550a7e1 100644 --- a/src/plugins/platforms/offscreen/offscreen.pro +++ b/src/plugins/platforms/offscreen/offscreen.pro @@ -1,10 +1,5 @@ TARGET = qoffscreen -PLUGIN_TYPE = platforms -PLUGIN_CLASS_NAME = QOffscreenIntegrationPlugin -!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = - -load(qt_plugin) - QT += core-private gui-private platformsupport-private SOURCES = main.cpp \ @@ -25,3 +20,8 @@ contains(QT_CONFIG, xlib):contains(QT_CONFIG, opengl):!contains(QT_CONFIG, openg } else { SOURCES += qoffscreenintegration_dummy.cpp } + +PLUGIN_TYPE = platforms +PLUGIN_CLASS_NAME = QOffscreenIntegrationPlugin +!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = - +load(qt_plugin) -- cgit v1.2.3