From b4b9e2908f74a61170d9d84597b90ed0d60f74fc Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 13 Jul 2009 13:03:26 -0700 Subject: 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 --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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(this); const QImage *img = that->buffer(); -- cgit v0.12