summaryrefslogtreecommitdiffstats
path: root/src/opengl/qwindowsurface_gl.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2010-09-27 09:41:38 (GMT)
committerGunnar Sletta <gunnar.sletta@nokia.com>2010-09-27 09:41:38 (GMT)
commit2271315eb46665b0a9e61ff0525340713163c1b6 (patch)
treed0068e34924eca85eb6af4089b3f443a89c929f6 /src/opengl/qwindowsurface_gl.cpp
parent33e7ee9d1866f12a9b92fe4b5549c31e30974d8e (diff)
parent53d010a989aed878c21522cbaf0d75c7cf821b42 (diff)
downloadQt-2271315eb46665b0a9e61ff0525340713163c1b6.zip
Qt-2271315eb46665b0a9e61ff0525340713163c1b6.tar.gz
Qt-2271315eb46665b0a9e61ff0525340713163c1b6.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt
Conflicts: configure src/corelib/global/qglobal.h
Diffstat (limited to 'src/opengl/qwindowsurface_gl.cpp')
-rw-r--r--src/opengl/qwindowsurface_gl.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 52abe5a..bc4912b 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -190,7 +190,10 @@ public:
QGLWidget *shareWidget() {
if (!initializing && !widget && !cleanedUp) {
initializing = true;
- widget = new QGLWidget;
+
+ widget = new QGLWidget(QGLFormat(QGL::SingleBuffer | QGL::NoDepthBuffer | QGL::NoStencilBuffer));
+ widget->resize(1, 1);
+
// We dont need this internal widget to appear in QApplication::topLevelWidgets()
if (QWidgetPrivate::allWidgets)
QWidgetPrivate::allWidgets->remove(widget);
@@ -342,12 +345,14 @@ QGLWindowSurface::~QGLWindowSurface()
void QGLWindowSurface::deleted(QObject *object)
{
- // Make sure that the fbo is destroyed before destroying its context.
- delete d_ptr->fbo;
- d_ptr->fbo = 0;
-
QWidget *widget = qobject_cast<QWidget *>(object);
if (widget) {
+ if (widget == window()) {
+ // Make sure that the fbo is destroyed before destroying its context.
+ delete d_ptr->fbo;
+ d_ptr->fbo = 0;
+ }
+
QWidgetPrivate *widgetPrivate = widget->d_func();
if (widgetPrivate->extraData()) {
union { QGLContext **ctxPtr; void **voidPtr; };
@@ -421,6 +426,8 @@ QPaintDevice *QGLWindowSurface::paintDevice()
QGLContext *ctx = reinterpret_cast<QGLContext *>(window()->d_func()->extraData()->glContext);
ctx->makeCurrent();
+
+ Q_ASSERT(d_ptr->fbo);
return d_ptr->fbo;
}