From d0b29a5238def992bf7946d5c3eb36129b0cc44b Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 9 Sep 2009 08:21:47 +1000 Subject: Fixes "Out of heap space" error when compiling on some setups. The original fix was for "out of stack space" due to to low a value, this one is for too high a value. --- demos/boxes/boxes.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 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 } -- cgit v0.12 From f52dc5bf1e885c9a4d226c2484249e7d9faf0a99 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Tue, 8 Sep 2009 10:20:36 -0700 Subject: Fix QDirectFBPixmapData::fromImage This fix should optimize pixmap loading on most platforms and also fixes a bug on a certain hardware where the alpha channel of an image was not retained upon loading it. This patch also takes care of handling dithering better in QDirectFBPixmapData::fromImage(). Reviewed-by: Donald Carr --- .../gfxdrivers/directfb/qdirectfbpixmap.cpp | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) 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); -- cgit v0.12