diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-09 00:39:12 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-09 00:39:12 (GMT) |
commit | 91340d865bad35bef5d4e75bcfc871171199066f (patch) | |
tree | f5359cd830fb6d0b48fa947ae36eadad9f7164a3 | |
parent | bff0ea73ea4316b915d087d1e01a3c617a769789 (diff) | |
parent | f52dc5bf1e885c9a4d226c2484249e7d9faf0a99 (diff) | |
download | Qt-91340d865bad35bef5d4e75bcfc871171199066f.zip Qt-91340d865bad35bef5d4e75bcfc871171199066f.tar.gz Qt-91340d865bad35bef5d4e75bcfc871171199066f.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r-- | demos/boxes/boxes.pro | 4 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 36 |
2 files changed, 32 insertions, 8 deletions
diff --git a/demos/boxes/boxes.pro b/demos/boxes/boxes.pro index 59c9132..4963fb9 100644 --- a/demos/boxes/boxes.pro +++ b/demos/boxes/boxes.pro @@ -44,6 +44,6 @@ wince*: { win32-msvc* { QMAKE_CXXFLAGS -= -Zm200 QMAKE_CFLAGS -= -Zm200 - QMAKE_CXXFLAGS += -Zm1200 - QMAKE_CFLAGS += -Zm1200 + QMAKE_CXXFLAGS += -Zm500 + QMAKE_CFLAGS += -Zm500 } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index 6550683..f88055e 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -330,17 +330,17 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti #endif -void QDirectFBPixmapData::fromImage(const QImage &image, +void QDirectFBPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags) { - if (image.depth() == 1) { - fromImage(image.convertToFormat(screen->alphaPixmapFormat()), flags); + if (img.depth() == 1) { + fromImage(img.convertToFormat(screen->alphaPixmapFormat()), flags); return; } - if (image.hasAlphaChannel() + if (img.hasAlphaChannel() #ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION - && (flags & Qt::NoOpaqueDetection || QDirectFBPixmapData::hasAlphaChannel(image)) + && (flags & Qt::NoOpaqueDetection || QDirectFBPixmapData::hasAlphaChannel(img)) #endif ) { alpha = true; @@ -349,13 +349,37 @@ void QDirectFBPixmapData::fromImage(const QImage &image, alpha = false; imageFormat = screen->pixelFormat(); } + QImage image; + if (flags != Qt::AutoColor) { + image = img.convertToFormat(imageFormat, flags); + flags = Qt::AutoColor; + } else { + image = img; + } + + IDirectFBSurface *imageSurface = screen->createDFBSurface(image, image.format(), QDirectFBScreen::DontTrackSurface); + if (!imageSurface) { + qWarning("QDirectFBPixmapData::fromImage()"); + invalidate(); + return; + } - dfbSurface = screen->createDFBSurface(image, imageFormat, QDirectFBScreen::TrackSurface|QDirectFBScreen::NoPreallocated); + dfbSurface = screen->createDFBSurface(image.size(), imageFormat, QDirectFBScreen::TrackSurface); if (!dfbSurface) { qWarning("QDirectFBPixmapData::fromImage()"); invalidate(); return; } + + if (image.hasAlphaChannel()) { + dfbSurface->Clear(dfbSurface, 0, 0, 0, 0); + dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_BLEND_ALPHACHANNEL); + } else { + dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX); + } + dfbSurface->Blit(dfbSurface, imageSurface, 0, 0, 0); + imageSurface->Release(imageSurface); + w = image.width(); h = image.height(); is_null = (w <= 0 || h <= 0); |