From f78a8f9c839969d3c3d2e9b4287bc62aa43f5f64 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 24 Apr 2009 09:26:04 +0200 Subject: Fix clipping bug in raster paint engine If we have a rect-clip where we actually had spans (used for cleartype) and then reused that clipdata, we would never re-create the spans, which would mean that future drawing would be filtered based on the old clip Reviewed-by: Samuel --- src/gui/painting/qpaintengine_raster.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index e981f8d..ba1e27c 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -4405,6 +4405,9 @@ void QClipData::fixup() */ void QClipData::setClipRect(const QRect &rect) { + if (rect == clipRect) + return; + // qDebug() << "setClipRect" << clipSpanHeight << count << allocated << rect; hasRectClip = true; clipRect = rect; @@ -4414,6 +4417,11 @@ void QClipData::setClipRect(const QRect &rect) ymin = qMin(rect.y(), clipSpanHeight); ymax = qMin(rect.y() + rect.height(), clipSpanHeight); + if (m_spans) { + delete m_spans; + m_spans = 0; + } + // qDebug() << xmin << xmax << ymin << ymax; } @@ -4437,6 +4445,12 @@ void QClipData::setClipRegion(const QRegion ®ion) ymin = rect.y(); ymax = rect.y() + rect.height(); } + + if (m_spans) { + delete m_spans; + m_spans = 0; + } + } /*! -- cgit v0.12