summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-07-13 20:03:26 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-07-13 20:34:18 (GMT)
commitb4b9e2908f74a61170d9d84597b90ed0d60f74fc (patch)
treee91b38deba32d6015c68bc0ae75c8838b4103d54 /src
parentafb4dfc7b9536b7e7f443a89e94f331f8946de07 (diff)
downloadQt-b4b9e2908f74a61170d9d84597b90ed0d60f74fc.zip
Qt-b4b9e2908f74a61170d9d84597b90ed0d60f74fc.tar.gz
Qt-b4b9e2908f74a61170d9d84597b90ed0d60f74fc.tar.bz2
Fix QDirectFBPixmap::toImage
Preallocated surfaces can currently be copied to video memory behind our back. This means that we can not use this mechanism for toImage() In later versions of DirectFB this might be possible to toggle with a flag so I'll leave the code in there #if 0'ed Reviewed-by: Donald <qt-info@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index ce3d6e4..c75cba6 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -329,6 +329,10 @@ QImage QDirectFBPixmapData::toImage() const
if (!dfbSurface)
return QImage();
+#if 0
+ // In later versions of DirectFB one can set a flag to tell
+ // DirectFB not to move the surface to videomemory. When that
+ // happens we can use this (hopefully faster) codepath
#ifndef QT_NO_DIRECTFB_PREALLOCATED
QImage ret(size(), QDirectFBScreen::getImageFormat(dfbSurface));
if (IDirectFBSurface *imgSurface = screen->createDFBSurface(ret, QDirectFBScreen::DontTrackSurface)) {
@@ -346,6 +350,7 @@ QImage QDirectFBPixmapData::toImage() const
return ret;
}
#endif
+#endif
QDirectFBPixmapData *that = const_cast<QDirectFBPixmapData*>(this);
const QImage *img = that->buffer();