summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2010-02-15 11:20:38 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2010-02-15 14:31:06 (GMT)
commit63e201038569cfbaf95d3191ae001379ca3026bd (patch)
treee1e581f772fd33b9a46023ba50bb6762dd89c4de
parentcae3c016afa72b4d6285d1efefddca4700239eee (diff)
downloadQt-63e201038569cfbaf95d3191ae001379ca3026bd.zip
Qt-63e201038569cfbaf95d3191ae001379ca3026bd.tar.gz
Qt-63e201038569cfbaf95d3191ae001379ca3026bd.tar.bz2
Prevented calling the pixmap filter implementations with null pixmaps.
Reviewed-by: Bjørn Erik Nilsen
-rw-r--r--src/gui/effects/qgraphicseffect.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index 10ef5ea..7d1d03d 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -699,12 +699,17 @@ void QGraphicsColorizeEffect::draw(QPainter *painter)
if (sourceIsPixmap()) {
// No point in drawing in device coordinates (pixmap will be scaled anyways).
const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset, NoPad);
- d->filter->draw(painter, offset, pixmap);
+ if (!pixmap.isNull())
+ d->filter->draw(painter, offset, pixmap);
+
return;
}
// Draw pixmap in deviceCoordinates to avoid pixmap scaling.
const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset);
+ if (pixmap.isNull())
+ return;
+
QTransform restoreTransform = painter->worldTransform();
painter->setWorldTransform(QTransform());
d->filter->draw(painter, offset, pixmap);
@@ -858,9 +863,11 @@ void QGraphicsBlurEffect::draw(QPainter *painter)
if (painter->paintEngine()->type() == QPaintEngine::OpenGL2)
mode = NoPad;
- // Draw pixmap in device coordinates to avoid pixmap scaling.
QPoint offset;
QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset, mode);
+ if (pixmap.isNull())
+ return;
+
d->filter->draw(painter, offset, pixmap);
}
@@ -1047,6 +1054,9 @@ void QGraphicsDropShadowEffect::draw(QPainter *painter)
// Draw pixmap in device coordinates to avoid pixmap scaling.
QPoint offset;
const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset, mode);
+ if (pixmap.isNull())
+ return;
+
QTransform restoreTransform = painter->worldTransform();
painter->setWorldTransform(QTransform());
d->filter->draw(painter, offset, pixmap);