diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-03-26 06:09:15 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-03-27 15:43:51 (GMT) |
commit | 43c5656d834739e86f2895cfbf3d539bb8c7c498 (patch) | |
tree | b52da52c77fd0b87913012bc6b5a0c3378dabe63 /src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp | |
parent | 062c476d378022a49307aca136cb9aab381e0814 (diff) | |
download | Qt-43c5656d834739e86f2895cfbf3d539bb8c7c498.zip Qt-43c5656d834739e86f2895cfbf3d539bb8c7c498.tar.gz Qt-43c5656d834739e86f2895cfbf3d539bb8c7c498.tar.bz2 |
Major surface related fix
Make sure all QDirectFBPaintDevice surfaces always are created with a
format that is either QScreen::pixelFormat() or
QDirectFBScreen::alphaPixmapFormat().
Also, clean up surface creation by providing more high level functions.
Fix a bug where we would assume that ARGB means
Format_ARGB32_Premultiplied and not Format_ARGB32.
Reviewed-by: Tom Cooksey
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index 8a30ad4..8dbad53 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -64,8 +64,6 @@ void QDirectFBPaintDevice::lockDirectFB() { void *mem; int w, h; - DFBSurfacePixelFormat format; - DFBResult result = dfbSurface->Lock(dfbSurface, DSLF_WRITE, &mem, &bpl); if (result != DFB_OK || !mem) { DirectFBError("QDirectFBPixmapData::buffer()", result); @@ -73,10 +71,8 @@ void QDirectFBPaintDevice::lockDirectFB() { } dfbSurface->GetSize(dfbSurface, &w, &h); - dfbSurface->GetPixelFormat(dfbSurface, &format); - lockedImage = new QImage(static_cast<uchar*>(mem), w, h, bpl, - QDirectFBScreen::getImageFormat(format)); + QDirectFBScreen::getImageFormat(dfbSurface)); } @@ -102,9 +98,7 @@ void* QDirectFBPaintDevice::memory() const QImage::Format QDirectFBPaintDevice::format() const { - DFBSurfacePixelFormat dfbFormat; - dfbSurface->GetPixelFormat(dfbSurface, &dfbFormat); - return QDirectFBScreen::getImageFormat(dfbFormat); + return QDirectFBScreen::getImageFormat(dfbSurface); } |