summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qstroker_p.h
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-09-27 11:02:47 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-09-27 12:04:35 (GMT)
commitd60dc7cba21794866c9382f83080fab1a129eb08 (patch)
treecb427a36cf9946e2f486d40be432f351fc9f9347 /src/gui/painting/qstroker_p.h
parent5ff714badf06f492c3f6f8282b64181cc93faadb (diff)
downloadQt-d60dc7cba21794866c9382f83080fab1a129eb08.zip
Qt-d60dc7cba21794866c9382f83080fab1a129eb08.tar.gz
Qt-d60dc7cba21794866c9382f83080fab1a129eb08.tar.bz2
Fixed performance regression in curve stroking.
Change c46688b8a88da made us use m_curve_threshold for both QBezier::shifted and QBezier::toPolygon, and adjusted the threshold dynamically based on the painter scale. Since the threshold in shifted was already relative to the pen width, it is independent from the painter scale. Instead, we need to set a separate threshold for dashing. Also, in several places we were calling setCurveThresholdForTransform with the painter matrix even though we were transforming the points into device coordinate space before stroking. Task-number: QTBUG-13894 Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/gui/painting/qstroker_p.h')
-rw-r--r--src/gui/painting/qstroker_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h
index d646135..5607a8e 100644
--- a/src/gui/painting/qstroker_p.h
+++ b/src/gui/painting/qstroker_p.h
@@ -168,7 +168,7 @@ public:
{
qreal scale;
qt_scaleForTransform(transform, &scale);
- setCurveThreshold(scale == 0 ? qreal(0.5) : (qreal(0.5) / scale));
+ m_dashThreshold = scale == 0 ? qreal(0.5) : (qreal(0.5) / scale);
}
void setCurveThreshold(qfixed threshold) { m_curveThreshold = threshold; }
@@ -184,6 +184,7 @@ protected:
QRectF m_clip_rect;
qfixed m_curveThreshold;
+ qfixed m_dashThreshold;
void *m_customData;
qStrokerMoveToHook m_moveTo;