summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-04-07 01:20:28 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-04-07 01:22:12 (GMT)
commit0002b0285269f69648a7eede33a1d9df5fab8c53 (patch)
tree0171fafa37ae708f029d14eba7c909eace4c757f
parent723eea029f98b802563c0bc06ba82ff741e1ac73 (diff)
downloadQt-0002b0285269f69648a7eede33a1d9df5fab8c53.zip
Qt-0002b0285269f69648a7eede33a1d9df5fab8c53.tar.gz
Qt-0002b0285269f69648a7eede33a1d9df5fab8c53.tar.bz2
Fix up some QT_...NO_PALETTE codepaths
Make sure we create the surface from the converted image and not the original one. Reviewed-by: TrustMe
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 39a2d48..dd147cf 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -171,7 +171,7 @@ IDirectFBSurface* QDirectFBScreen::createDFBSurface(const QImage &img, SurfaceCr
}
#endif
#ifndef QT_NO_DIRECTFB_PALETTE
- if (img.numColors() != 0)
+ if (img.numColors() != 0 && surface)
QDirectFBScreen::setSurfaceColorTable(surface, img);
#endif
return surface;
@@ -261,19 +261,21 @@ IDirectFBSurface *QDirectFBScreen::copyToDFBSurface(const QImage &img,
#ifdef QT_NO_DIRECTFB_PREALLOCATED
|| image.format() != pixmapFormat
#endif
+#ifdef QT_NO_DIRECTFB_PALETTE
+ || image.numColors() != 0
+#endif
) {
image = image.convertToFormat(pixmapFormat);
}
-
- IDirectFBSurface *dfbSurface = createDFBSurface(img.size(), pixmapFormat, options);
+ IDirectFBSurface *dfbSurface = createDFBSurface(image.size(), pixmapFormat, options);
if (!dfbSurface) {
qWarning("QDirectFBPixmapData::fromImage() Couldn't create surface");
return 0;
}
#ifndef QT_NO_DIRECTFB_PREALLOCATED
- IDirectFBSurface *imgSurface = createDFBSurface(img, DontTrackSurface);
+ IDirectFBSurface *imgSurface = createDFBSurface(image, DontTrackSurface);
if (!imgSurface) {
qWarning("QDirectFBPixmapData::fromImage()");
QDirectFBScreen::releaseDFBSurface(dfbSurface);