summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-03-31 04:51:33 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-03-31 17:35:30 (GMT)
commit810bbcd38e8f829ccc6702f5cdf2bb97bbca97cc (patch)
treed39465e8dc01c40fabd8aec9b40792783698ed19 /src
parent12849e1767f3f881c9060368c3a14fae6e5a9ef1 (diff)
downloadQt-810bbcd38e8f829ccc6702f5cdf2bb97bbca97cc.zip
Qt-810bbcd38e8f829ccc6702f5cdf2bb97bbca97cc.tar.gz
Qt-810bbcd38e8f829ccc6702f5cdf2bb97bbca97cc.tar.bz2
No sense in detecting the format twice
Use the format passed in to the function rather than detecting it again based on hasAlphaChannel(). Reviewed-by: Tom Cooksey <thomas.cooksey@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 3a6b3a2..fd6f48a 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -249,14 +249,10 @@ IDirectFBSurface* QDirectFBScreen::createDFBSurface(const DFBSurfaceDescription
}
IDirectFBSurface *QDirectFBScreen::copyToDFBSurface(const QImage &img,
- QImage::Format format,
+ QImage::Format pixmapFormat,
SurfaceCreationOptions options)
{
QImage image = img;
- const QImage::Format pixmapFormat = image.hasAlphaChannel()
- ? QDirectFBScreen::alphaPixmapFormat()
- : QDirectFBScreen::pixelFormat();
-
if (QDirectFBScreen::getSurfacePixelFormat(image.format()) == DSPF_UNKNOWN
#ifdef QT_NO_DIRECTFB_PREALLOCATED
|| image.format() != pixmapFormat
@@ -266,7 +262,7 @@ IDirectFBSurface *QDirectFBScreen::copyToDFBSurface(const QImage &img,
}
- IDirectFBSurface *dfbSurface = createDFBSurface(img.size(), format, options);
+ IDirectFBSurface *dfbSurface = createDFBSurface(img.size(), pixmapFormat, options);
if (!dfbSurface) {
qWarning("QDirectFBPixmapData::fromImage() Couldn't create surface");
return 0;