summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-05-04 17:38:37 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-05-04 17:48:02 (GMT)
commit885adf0541e4b709bf5a3774361e85db2a35fc47 (patch)
tree6f4ca4ef6870876d4286d2f1ba4939de95a55e21 /src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
parenta5c1161fb6bb2a24cebc104bc2a9b8def0a6e466 (diff)
downloadQt-885adf0541e4b709bf5a3774361e85db2a35fc47.zip
Qt-885adf0541e4b709bf5a3774361e85db2a35fc47.tar.gz
Qt-885adf0541e4b709bf5a3774361e85db2a35fc47.tar.bz2
Lock for read only when possible
From benchmarking I've established that surface->Lock(DSLF_READ) is faster than surface->Lock(DSLF_WRITE) which is faster than surface->Lock(DSLF_READ|DSLF_WRITE). This patch will make us Lock for read only, when possible. Reviewed-by: Donald <qt-info@nokia.com>
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 14d2146..e9e2b1f 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -1040,7 +1040,7 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap,
QRasterPaintEngine::drawPixmap(r, pixmap, sr);
} else if (!d->dfbCanHandleClip(r) || d->matrixRotShear) {
RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr);
- const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer();
+ const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
d->lock();
QRasterPaintEngine::drawImage(r, *img, sr);
} else {
@@ -1066,7 +1066,7 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r,
QRasterPaintEngine::drawTiledPixmap(r, pixmap, sp);
} else if (!d->dfbCanHandleClip(r) || d->matrixRotShear || !sp.isNull()) {
RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), sp);
- const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer();
+ const QImage *img = static_cast<QDirectFBPixmapData*>(pixmap.pixmapData())->buffer(DSLF_READ);
d->lock();
QRasterPixmapData *data = new QRasterPixmapData(QPixmapData::PixmapType);
data->fromImage(*img, Qt::AutoColor);