diff options
author | Anders Bakken <agbakken@gmail.com> | 2010-10-08 17:21:25 (GMT) |
---|---|---|
committer | Donald Carr <donald.carr@nokia.com> | 2010-10-21 19:53:16 (GMT) |
commit | 91340390f4968241a804c259c4a468f0a526436d (patch) | |
tree | 28efbf4260fed9b97e8e4cb5739a9789567b2fb3 | |
parent | d59027e27767fde354113da26fce3f3ba279bb68 (diff) | |
download | Qt-91340390f4968241a804c259c4a468f0a526436d.zip Qt-91340390f4968241a804c259c4a468f0a526436d.tar.gz Qt-91340390f4968241a804c259c4a468f0a526436d.tar.bz2 |
Fall back to Qt for loading images with DICAPS_COLORKEY.
Merge-request: 844
Reviewed-by: Donald Carr <donald.carr@nokia.com>
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index c0d96d7..ce3a05a 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -251,12 +251,6 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti } QDirectFBPointer<IDirectFBImageProvider> provider(providerPtr); - DFBSurfaceDescription surfaceDescription; - if ((result = provider->GetSurfaceDescription(provider.data(), &surfaceDescription)) != DFB_OK) { - DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't get surface description", result); - return false; - } - DFBImageDescription imageDescription; result = provider->GetImageDescription(provider.data(), &imageDescription); if (result != DFB_OK) { @@ -264,7 +258,17 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti return false; } - alpha = imageDescription.caps & (DICAPS_ALPHACHANNEL|DICAPS_COLORKEY); + if (imageDescription.caps & DICAPS_COLORKEY) { + return false; + } + + DFBSurfaceDescription surfaceDescription; + if ((result = provider->GetSurfaceDescription(provider.data(), &surfaceDescription)) != DFB_OK) { + DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't get surface description", result); + return false; + } + + alpha = imageDescription.caps & DICAPS_ALPHACHANNEL; imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat(); dfbSurface = screen->createDFBSurface(QSize(surfaceDescription.width, surfaceDescription.height), |