summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-03-30 13:21:59 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-04-07 06:27:32 (GMT)
commit470d87ac503debe3bead80628044d176479975eb (patch)
treef110728aaee8e60c6a1b2f51e742d99b28cb5d70 /src/gui
parentd821e3288c3f3dee0c4591e6fc64114511559680 (diff)
downloadQt-470d87ac503debe3bead80628044d176479975eb.zip
Qt-470d87ac503debe3bead80628044d176479975eb.tar.gz
Qt-470d87ac503debe3bead80628044d176479975eb.tar.bz2
Fixes: Make drawPixmap slightly more optimal for QPaintEngineEx
RevBy: Samuel
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qpainter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index fe6cc69..b2f0ac4 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5155,9 +5155,6 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm)
Q_D(QPainter);
- if (!d->engine || pm.isNull())
- return;
-
#ifndef QT_NO_DEBUG
qt_painter_thread_test(d->device->devType(), "drawPixmap()");
#endif
@@ -5167,12 +5164,18 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm)
return;
}
+ if (!d->engine)
+ return;
+
qreal x = p.x();
qreal y = p.y();
int w = pm.width();
int h = pm.height();
+ if (w <= 0)
+ return;
+
// Emulate opaque background for bitmaps
if (d->state->bgMode == Qt::OpaqueMode && pm.isQBitmap()) {
fillRect(QRectF(x, y, w, h), d->state->bgBrush.color());