diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-11-23 14:34:09 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-11-24 08:54:48 (GMT) |
commit | 004cd14b84e3683cd92cf01061ee9688990f990c (patch) | |
tree | 8f879f07439b212de831c528e832d3c3ab4c6bb3 /src/gui/kernel | |
parent | f309a20b4177572282082b8c17ec9025b75a69b1 (diff) | |
download | Qt-004cd14b84e3683cd92cf01061ee9688990f990c.zip Qt-004cd14b84e3683cd92cf01061ee9688990f990c.tar.gz Qt-004cd14b84e3683cd92cf01061ee9688990f990c.tar.bz2 |
Lighthouse: Fix QGLContext::currentContext for systems with limited
resources. The example plugins EGLFS uses only 1 native
context. Make sure that we only use this 1 context, and that we dont
wrap it in many different QPlatformGLContexts or QGLContexts instanses.
This change also removes the QPlatformWindow link which was made in the
initial QPlatformGLContext change. Lighthouse has to support situations
where a context isnt bound to a QPlatformWindow.
Reviewed-by: gunnar
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qplatformglcontext_qpa.cpp | 18 | ||||
-rw-r--r-- | src/gui/kernel/qplatformglcontext_qpa.h | 4 |
2 files changed, 5 insertions, 17 deletions
diff --git a/src/gui/kernel/qplatformglcontext_qpa.cpp b/src/gui/kernel/qplatformglcontext_qpa.cpp index a450b33..5d2faf1 100644 --- a/src/gui/kernel/qplatformglcontext_qpa.cpp +++ b/src/gui/kernel/qplatformglcontext_qpa.cpp @@ -61,8 +61,8 @@ static QThreadStorage<QPlatformGLThreadContext *> qplatformgl_context_storage; class QPlatformGLContextPrivate { public: - QPlatformGLContextPrivate(QPlatformWindow *platformWindow) - :qGLContextHandle(0),platformWindow(platformWindow) + QPlatformGLContextPrivate() + :qGLContextHandle(0) { } @@ -73,7 +73,6 @@ public: } void *qGLContextHandle; void (*qGLContextDeleteFunction)(void *handle); - QPlatformWindow *platformWindow; static QPlatformGLContext *staticSharedContext; static void setCurrentContext(QPlatformGLContext *context); @@ -96,15 +95,6 @@ void QPlatformGLContextPrivate::setCurrentContext(QPlatformGLContext *context) } /*! - Returns the platformWindow which this QPlatformGLContext belongs to. -*/ -QPlatformWindow *QPlatformGLContext::platformWindow() const -{ - Q_D(const QPlatformGLContext); - return d->platformWindow; -} - -/*! Returns the last context which called makeCurrent. This function is thread aware. */ const QPlatformGLContext* QPlatformGLContext::currentContext() @@ -119,8 +109,8 @@ const QPlatformGLContext* QPlatformGLContext::currentContext() /*! All subclasses needs to specify the platformWindow. It can be a null window. */ -QPlatformGLContext::QPlatformGLContext(QPlatformWindow *platformWindow) - :d_ptr(new QPlatformGLContextPrivate(platformWindow)) +QPlatformGLContext::QPlatformGLContext() + :d_ptr(new QPlatformGLContextPrivate()) { } diff --git a/src/gui/kernel/qplatformglcontext_qpa.h b/src/gui/kernel/qplatformglcontext_qpa.h index 3e10c2b..a70e046 100644 --- a/src/gui/kernel/qplatformglcontext_qpa.h +++ b/src/gui/kernel/qplatformglcontext_qpa.h @@ -58,7 +58,7 @@ class Q_OPENGL_EXPORT QPlatformGLContext Q_DECLARE_PRIVATE(QPlatformGLContext); public: - explicit QPlatformGLContext(QPlatformWindow *platformWindow); + explicit QPlatformGLContext(); virtual ~QPlatformGLContext(); virtual void makeCurrent(); @@ -68,8 +68,6 @@ public: virtual QPlatformWindowFormat platformWindowFormat() const = 0; - QPlatformWindow *platformWindow() const; - const static QPlatformGLContext *currentContext(); const static QPlatformGLContext *defaultSharedContext(); |