summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-09-18 16:06:36 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-09-18 16:27:58 (GMT)
commitfece4080b02a8edfd743919bb694bd8e9c1e1271 (patch)
tree0157f7026de2f71f84c5e6d6250c69997d19423e /src/plugins/gfxdrivers
parent87a8e182cbecde15fbf0af439b77a0ec7146274e (diff)
downloadQt-fece4080b02a8edfd743919bb694bd8e9c1e1271.zip
Qt-fece4080b02a8edfd743919bb694bd8e9c1e1271.tar.gz
Qt-fece4080b02a8edfd743919bb694bd8e9c1e1271.tar.bz2
A pen/brush can be invalid and have a valid color
This code is wrong: if (brush != Qt::NoBrush) ... It should be: if (brush.style() != Qt::NoBrush) ... Reviewed-by: Jervey Kong <jervey.kong@nokia.com>
Diffstat (limited to 'src/plugins/gfxdrivers')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 40476e9..043189e 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -399,7 +399,7 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount)
Q_D(QDirectFBPaintEngine);
const QPen &pen = state()->pen;
const QBrush &brush = state()->brush;
- if (brush == Qt::NoBrush && pen == Qt::NoPen)
+ if (brush.style() == Qt::NoBrush && pen.style() == Qt::NoPen)
return;
if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives)
@@ -412,11 +412,13 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount)
QRasterPaintEngine::drawRects(rects, rectCount);
return;
}
- if (brush != Qt::NoBrush) {
+
+ if (brush.style() != Qt::NoBrush) {
d->setDFBColor(brush.color());
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(fillRects<QRect>)(rects, rectCount, state()->matrix, d->surface));
}
- if (pen != Qt::NoPen) {
+
+ if (pen.style() != Qt::NoPen) {
d->setDFBColor(pen.color());
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects<QRect>)(rects, rectCount, state()->matrix, d->surface));
}
@@ -427,7 +429,7 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount)
Q_D(QDirectFBPaintEngine);
const QPen &pen = state()->pen;
const QBrush &brush = state()->brush;
- if (brush == Qt::NoBrush && pen == Qt::NoPen)
+ if (brush.style() == Qt::NoBrush && pen.style() == Qt::NoPen)
return;
if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives)
@@ -440,11 +442,13 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount)
QRasterPaintEngine::drawRects(rects, rectCount);
return;
}
- if (brush != Qt::NoBrush) {
+
+ if (brush.style() != Qt::NoBrush) {
d->setDFBColor(brush.color());
CLIPPED_PAINT(fillRects<QRectF>(rects, rectCount, state()->matrix, d->surface));
}
- if (pen != Qt::NoPen) {
+
+ if (pen.style() != Qt::NoPen) {
d->setDFBColor(pen.color());
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects<QRectF>)(rects, rectCount, state()->matrix, d->surface));
}
@@ -464,7 +468,7 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount)
}
const QPen &pen = state()->pen;
- if (pen != Qt::NoPen) {
+ if (pen.style() != Qt::NoPen) {
d->setDFBColor(pen.color());
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines<QLine>)(lines, lineCount, state()->matrix, d->surface));
}
@@ -484,7 +488,7 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount)
}
const QPen &pen = state()->pen;
- if (pen != Qt::NoPen) {
+ if (pen.style() != Qt::NoPen) {
d->setDFBColor(pen.color());
CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines<QLineF>)(lines, lineCount, state()->matrix, d->surface));
}