diff options
author | Uwe Rathmann <Uwe.Rathmann@tigertal.de> | 2010-06-26 12:34:49 (GMT) |
---|---|---|
committer | Donald Carr <donald.carr@nokia.com> | 2010-08-17 15:13:25 (GMT) |
commit | 5eaf1f41b17eb6f73420f1a9a5e48957015d2e4e (patch) | |
tree | c2d891946cfca030ba5c23bcf9da20ac713aa087 /src | |
parent | 1970e2d46656db8178636e06c82287f536b626c7 (diff) | |
download | Qt-5eaf1f41b17eb6f73420f1a9a5e48957015d2e4e.zip Qt-5eaf1f41b17eb6f73420f1a9a5e48957015d2e4e.tar.gz Qt-5eaf1f41b17eb6f73420f1a9a5e48957015d2e4e.tar.bz2 |
Fixes QWS window decoration offset issues
When using OpenGL ES in conjunction with Qt/Embedded,
Q_BACKINGSTORE_SUBSURFACES is defined and the subsequent code path shared
between this define and QWS defines results in window decoration offset
errors.
Merge-request: 714
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qbackingstore.cpp | 9 | ||||
-rw-r--r-- | src/gui/painting/qwindowsurface_qws.cpp | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index 83751ed..446c867 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -353,8 +353,10 @@ void QWidgetBackingStore::beginPaint(QRegion &toClean, QWidget *widget, QWindowS dirtyOnScreen += toClean; #ifdef Q_WS_QWS +#ifndef Q_BACKINGSTORE_SUBSURFACES toClean.translate(tlwOffset); #endif +#endif #ifdef QT_NO_PAINT_DEBUG windowSurface->beginPaint(toClean); @@ -1294,7 +1296,12 @@ void QWidgetBackingStore::sync() #ifdef Q_BACKINGSTORE_SUBSURFACES QWindowSurface *subSurface = w->windowSurface(); BeginPaintInfo beginPaintInfo; - beginPaint(toBePainted, w, subSurface, &beginPaintInfo, false); + + QPoint off = w->mapTo(tlw, QPoint()); + toBePainted.translate(off); + beginPaint(toBePainted, w, subSurface, &beginPaintInfo, true); + toBePainted.translate(-off); + if (beginPaintInfo.nothingToPaint) continue; diff --git a/src/gui/painting/qwindowsurface_qws.cpp b/src/gui/painting/qwindowsurface_qws.cpp index a816ed2..170668b 100644 --- a/src/gui/painting/qwindowsurface_qws.cpp +++ b/src/gui/painting/qwindowsurface_qws.cpp @@ -882,7 +882,11 @@ void QWSMemorySurface::beginPaint(const QRegion &rgn) const QVector<QRect> rects = rgn.rects(); const QColor blank = Qt::transparent; for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) { - p.fillRect(*it, blank); + QRect r = *it; +#ifdef Q_BACKINGSTORE_SUBSURFACES + r.translate(painterOffset()); +#endif + p.fillRect(r, blank); } } QWSWindowSurface::beginPaint(rgn); |