summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-06-24 14:29:32 -0700
committerAnders Bakken <anders.bakken@nokia.com>2009-06-24 14:51:18 -0700
commit9d66697a72dd3c26ed744ffecab50722eb9adaee (patch)
treedfdb825ea0a2f3c4446636da7035d38e63803e1e /src/plugins/gfxdrivers
parent592d9767f4299d7ad8a3b923cf0d272ec9c32861 (diff)
Fix a rendering issue
Make sure surfaces always are locked when used as source for something. Reviewed-by: TrustMe
Diffstat (limited to 'src/plugins/gfxdrivers')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp5
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp6
2 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index c77cd78ae8..3edef8f052 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -567,6 +567,7 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap,
QPixmapData *data = pixmap.pixmapData();
Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
+ dfbData->unlockDirectFB();
IDirectFBSurface *s = dfbData->directFBSurface();
d->blit(r, s, sr);
}
@@ -598,6 +599,10 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r,
QRasterPaintEngine::drawTiledPixmap(r, pix, sp);
} else {
d->unlock();
+ QPixmapData *data = pixmap.pixmapData();
+ Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
+ QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
+ dfbData->unlockDirectFB();
d->drawTiledPixmap(r, pixmap);
}
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index c2048d8a30..ce3d6e499b 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -81,11 +81,9 @@ void QDirectFBPixmapData::resize(int width, int height)
qWarning("QDirectFBPixmapData::resize(): Unable to allocate surface");
return;
}
-
setSerialNumber(++global_ser_no);
}
-
// mostly duplicated from qimage.cpp (QImageData::checkForAlphaPixels)
static bool checkForAlphaPixels(const QImage &img)
{
@@ -200,6 +198,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
QPixmapData::copy(data, rect);
return;
}
+ unlockDirectFB();
IDirectFBSurface *src = static_cast<const QDirectFBPixmapData*>(data)->directFBSurface();
alpha = data->hasAlphaChannel();
@@ -282,10 +281,10 @@ void QDirectFBPixmapData::fill(const QColor &color)
QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
Qt::TransformationMode mode) const
{
+ QDirectFBPixmapData *that = const_cast<QDirectFBPixmapData*>(this);
if (!dfbSurface || transform.type() != QTransform::TxScale
|| mode != Qt::FastTransformation)
{
- QDirectFBPixmapData *that = const_cast<QDirectFBPixmapData*>(this);
const QImage *image = that->buffer();
Q_ASSERT(image);
const QImage transformed = image->transformed(transform, mode);
@@ -294,6 +293,7 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
data->fromImage(transformed, Qt::AutoColor);
return QPixmap(data);
}
+ that->unlockDirectFB();
int w, h;
dfbSurface->GetSize(dfbSurface, &w, &h);