diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-06-24 21:29:32 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2009-06-24 21:51:18 (GMT) |
commit | 9d66697a72dd3c26ed744ffecab50722eb9adaee (patch) | |
tree | dfdb825ea0a2f3c4446636da7035d38e63803e1e /src/plugins | |
parent | 592d9767f4299d7ad8a3b923cf0d272ec9c32861 (diff) | |
download | Qt-9d66697a72dd3c26ed744ffecab50722eb9adaee.zip Qt-9d66697a72dd3c26ed744ffecab50722eb9adaee.tar.gz Qt-9d66697a72dd3c26ed744ffecab50722eb9adaee.tar.bz2 |
Fix a rendering issue
Make sure surfaces always are locked when used as source for something.
Reviewed-by: TrustMe
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 5 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index c77cd78..3edef8f 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 c2048d8..ce3d6e4 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); |