summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-02 17:35:17 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-09-03 10:40:20 (GMT)
commitd3673b331426346167e4dd1cd6c7b78ab7bf5176 (patch)
tree2b333a4b9b33ced610f01279f7a7b7331f934c82
parent464ee98eee5ce160b497aec6a1163422980dd797 (diff)
downloadQt-d3673b331426346167e4dd1cd6c7b78ab7bf5176.zip
Qt-d3673b331426346167e4dd1cd6c7b78ab7bf5176.tar.gz
Qt-d3673b331426346167e4dd1cd6c7b78ab7bf5176.tar.bz2
Fixed some clipping bugs in raster paint engine.
Clip against the correct base region in clip(const QRegion &, ...) and make sure to not access QClipData's clipRect unless hasRectClip is true. This fixes the tst_QWidget::render_systemClip3() autotest, and the clipping bugs in Qt Creator. Task-number: 260666 Reviewed-by: Gunnar Sletta
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 86b2d0f..81924ff 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1391,7 +1391,7 @@ void QRasterPaintEngine::clip(const QRegion &region, Qt::ClipOperation op)
if (curClip->hasRectClip)
newClip->setClipRegion(r & curClip->clipRect);
else if (curClip->hasRegionClip)
- newClip->setClipRegion(r & clip->clipRegion);
+ newClip->setClipRegion(r & curClip->clipRegion);
qrasterpaintengine_dirty_clip(d, s);
}
@@ -3079,11 +3079,11 @@ bool QRasterPaintEnginePrivate::isUnclipped_normalized(const QRect &r) const
}
- // currently all painting functions clips to deviceRect internally
- if (cl->clipRect == deviceRect)
- return true;
-
if (cl->hasRectClip) {
+ // currently all painting functions clips to deviceRect internally
+ if (cl->clipRect == deviceRect)
+ return true;
+
// inline contains() for performance (we know the rects are normalized)
const QRect &r1 = cl->clipRect;
return (r.left() >= r1.left() && r.right() <= r1.right()
@@ -3109,7 +3109,7 @@ bool QRasterPaintEnginePrivate::isUnclipped(const QRect &rect,
// currently all painting functions that call this function clip to deviceRect internally
- if (cl->clipRect == deviceRect)
+ if (cl->hasRectClip && cl->clipRect == deviceRect)
return true;
if (s->flags.antialiased)
@@ -3123,7 +3123,7 @@ bool QRasterPaintEnginePrivate::isUnclipped(const QRect &rect,
r.setHeight(r.height() + 2 * penWidth);
}
- if (!cl->clipRect.isEmpty()) {
+ if (cl->hasRectClip) {
// inline contains() for performance (we know the rects are normalized)
const QRect &r1 = cl->clipRect;
return (r.left() >= r1.left() && r.right() <= r1.right()