From 2d39471897f0a3a769406ec9c2b39558ebd45af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 26 Jan 2012 11:44:05 +0100 Subject: Introduced QOpenGLContext::defaultFramebufferObject(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also add some debugging helpers to make sure applications are correctly written even on less restrictive platforms. Change-Id: Ie92e497c32e07b2b83662f7ab5540d8f37777fd0 Reviewed-by: Jørgen Lind --- src/gui/kernel/qopenglcontext_p.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qopenglcontext_p.h') diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h index bd5fae989b..819f86fb24 100644 --- a/src/gui/kernel/qopenglcontext_p.h +++ b/src/gui/kernel/qopenglcontext_p.h @@ -47,6 +47,10 @@ #include #include +#ifndef QT_NO_DEBUG +#include +#endif + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -185,7 +189,6 @@ public: , surface(0) , functions(0) , current_fbo(0) - , default_fbo(0) , workaround_brokenFBOReadBack(false) , workaround_brokenTexSubImage(false) , active_engine(0) @@ -210,7 +213,6 @@ public: QOpenGLFunctions *functions; GLuint current_fbo; - GLuint default_fbo; bool workaround_brokenFBOReadBack; bool workaround_brokenTexSubImage; @@ -220,6 +222,23 @@ public: static void setCurrentContext(QOpenGLContext *context); int maxTextureSize() const { return 1024; } + +#if !defined(QT_NO_DEBUG) + static bool toggleMakeCurrentTracker(QOpenGLContext *context, bool value) + { + QMutexLocker locker(&makeCurrentTrackerMutex); + bool old = makeCurrentTracker.value(context, false); + makeCurrentTracker.insert(context, value); + return old; + } + static void cleanMakeCurrentTracker(QOpenGLContext *context) + { + QMutexLocker locker(&makeCurrentTrackerMutex); + makeCurrentTracker.remove(context); + } + static QHash makeCurrentTracker; + static QMutex makeCurrentTrackerMutex; +#endif }; QT_END_NAMESPACE -- cgit v1.2.3