diff options
author | Bjoern Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-04-27 15:16:59 (GMT) |
---|---|---|
committer | Bjoern Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-04-27 15:35:46 (GMT) |
commit | 8ebe882b077fffedc3ff80fb80d2e181d5e56ab8 (patch) | |
tree | 4d545f2c36bfb803fefc7bc66cbc983e4565d578 /src/opengl | |
parent | 73fefcfb67b2de42a0675eb88aaa5cb2751402e6 (diff) | |
download | Qt-8ebe882b077fffedc3ff80fb80d2e181d5e56ab8.zip Qt-8ebe882b077fffedc3ff80fb80d2e181d5e56ab8.tar.gz Qt-8ebe882b077fffedc3ff80fb80d2e181d5e56ab8.tar.bz2 |
Fixes wrong QPaintEvent::region() in QGLWidget::paintEvent.
QGLWidget does not support partial updates unless the context is
single buffered and auto-fill background is disabled. The problem
was that QPaintEvent::region() returned the requested update region
without taking into account the limitation of QGLWidget. If QGLWidget
doesn't support partial updates, it means everything has to be updated,
and QPaintEvent::region() must return the whole widget rect.
Auto test included.
Task-number: 241785
Reviewed-by: Trond
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qgl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index b4a0e5c..8ffee87 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2398,6 +2398,10 @@ bool QGLContext::create(const QGLContext* shareContext) return false; reset(); d->valid = chooseContext(shareContext); + if (d->valid && d->paintDevice->devType() == QInternal::Widget) { + QWidgetPrivate *wd = qt_widget_private(static_cast<QWidget *>(d->paintDevice)); + wd->usesDoubleBufferedGLContext = d->glFormat.doubleBuffer(); + } if (d->sharing) // ok, we managed to share qgl_share_reg()->addShare(this, shareContext); return d->valid; |