summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2010-01-15 12:23:51 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2010-01-25 12:29:30 (GMT)
commit6a3889146985e9e95b8a54e31003be8265e2469e (patch)
treee4529a0a68a6cea49bb182a9c6feb3b074acab99 /src/gui/painting
parent517631a6021a480e4098e39e7d6f65d91c35559d (diff)
downloadQt-6a3889146985e9e95b8a54e31003be8265e2469e.zip
Qt-6a3889146985e9e95b8a54e31003be8265e2469e.tar.gz
Qt-6a3889146985e9e95b8a54e31003be8265e2469e.tar.bz2
Small optimization in raster paint engine.
Don't repeatedly update the pen / brush if no pen / brush is set. Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index b937f66..a1c73cc 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -264,13 +264,13 @@ private:
#endif // Q_OS_SYMBIAN && QT_NO_FREETYPE
inline void ensureBrush(const QBrush &brush) {
- if (!qbrush_fast_equals(state()->lastBrush, brush) || state()->fillFlags)
+ if (!qbrush_fast_equals(state()->lastBrush, brush) || (brush.style() != Qt::NoBrush && state()->fillFlags))
updateBrush(brush);
}
inline void ensureBrush() { ensureBrush(state()->brush); }
inline void ensurePen(const QPen &pen) {
- if (!qpen_fast_equals(state()->lastPen, pen) || state()->strokeFlags)
+ if (!qpen_fast_equals(state()->lastPen, pen) || (pen.style() != Qt::NoPen && state()->strokeFlags))
updatePen(pen);
}
inline void ensurePen() { ensurePen(state()->pen); }