summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_p.h
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-14 02:30:44 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-14 05:06:06 (GMT)
commit9e3fb515207f8d80fe87b6e34e78d3d201b0b438 (patch)
treee89933d4ba8f65f5099e1beaab33a514c247e2cd /src/opengl/qgl_p.h
parent732660e89af34c76f6aa8a46ce8507dfd5fad077 (diff)
downloadQt-9e3fb515207f8d80fe87b6e34e78d3d201b0b438.zip
Qt-9e3fb515207f8d80fe87b6e34e78d3d201b0b438.tar.gz
Qt-9e3fb515207f8d80fe87b6e34e78d3d201b0b438.tar.bz2
Performance: reduce TLS overhead of QGLContext::currentContext()
The handling for the current QGLContext was looking up the same TLS data several times per call (hasLocalData() and localData() calls particularly). This change also refactors the code a little so that the setting of the QGLContext within makeCurrent() and doneCurrent() is in one location in the code instead of six (one per platform). Reviewed-by: Michael Brasser Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl/qgl_p.h')
-rw-r--r--src/opengl/qgl_p.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 57b40fb..2b74e69 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -351,6 +351,8 @@ public:
static inline QGLExtensionFuncs& extensionFuncs(QGLContextGroup *) { return qt_extensionFuncs; }
#endif
+ static void setCurrentContext(QGLContext *context);
+
QPixmapFilter *createPixmapFilter(int type) const;
};
@@ -398,11 +400,6 @@ public:
Q_DECLARE_OPERATORS_FOR_FLAGS(QGLExtensions::Extensions)
-struct QGLThreadContext {
- QGLContext *context;
-};
-extern QThreadStorage<QGLThreadContext *> qgl_context_storage;
-
class QGLShareRegister
{
public: