summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qopenglcontext_p.h
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-01-26 11:44:05 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-27 10:58:32 +0100
commit2d39471897f0a3a769406ec9c2b39558ebd45af3 (patch)
tree8c417f4ba814e9dbe70e56bdbf8a13cc46b3827f /src/gui/kernel/qopenglcontext_p.h
parent365b5f7a9271e5fc503b10e6c17371d76643fc94 (diff)
Introduced QOpenGLContext::defaultFramebufferObject().
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 <jorgen.lind@nokia.com>
Diffstat (limited to 'src/gui/kernel/qopenglcontext_p.h')
-rw-r--r--src/gui/kernel/qopenglcontext_p.h23
1 files changed, 21 insertions, 2 deletions
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 <private/qobject_p.h>
#include <qmutex.h>
+#ifndef QT_NO_DEBUG
+#include <QtCore/QHash>
+#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<QOpenGLContext *, bool> makeCurrentTracker;
+ static QMutex makeCurrentTrackerMutex;
+#endif
};
QT_END_NAMESPACE