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/gui/painting | |
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/gui/painting')
-rw-r--r-- | src/gui/painting/qbackingstore.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index fbac811a..34df6c9 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -1517,13 +1517,20 @@ void QWidgetPrivate::repaint_sys(const QRegion &rgn) extra->staticContentsSize = data.crect.size(); } + QPaintEngine *engine = q->paintEngine(); + // QGLWidget does not support partial updates if: + // 1) The context is double buffered + // 2) The context is single buffered and auto-fill background is enabled. + const bool noPartialUpdateSupport = (engine && engine->type() == QPaintEngine::OpenGL) + && (usesDoubleBufferedGLContext || q->autoFillBackground()); + QRegion toBePainted(noPartialUpdateSupport ? q->rect() : rgn); + #ifdef Q_WS_MAC // No difference between update() and repaint() on the Mac. - update_sys(rgn); + update_sys(toBePainted); return; #endif - QRegion toBePainted(rgn); toBePainted &= clipRect(); clipToEffectiveMask(toBePainted); if (toBePainted.isEmpty()) |