summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-07-13 13:03:26 -0700
committerAnders Bakken <anders.bakken@nokia.com>2009-07-13 13:34:18 -0700
commitb4b9e2908f74a61170d9d84597b90ed0d60f74fc (patch)
treee91b38deba32d6015c68bc0ae75c8838b4103d54 /src/plugins
parentafb4dfc7b9536b7e7f443a89e94f331f8946de07 (diff)
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/plugins')
-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 ce3d6e499b..c75cba64ad 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();