From 5e119ec1e765f1f33430632ed245242cdc9d37f1 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 17 Feb 2010 17:19:58 -0800 Subject: Allow forcing premultiplied format in DFB This was already possible in non-WM mode. I now enable using the same connect argument to make it work for WM. Reviewed-by: Jervey Kong --- src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index cd4d5c2..b447967 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -1139,6 +1139,8 @@ bool QDirectFBScreen::connect(const QString &displaySpec) #endif d_ptr->dfb->SetCooperativeLevel(d_ptr->dfb, DFSCL_FULLSCREEN); + const bool forcePremultiplied = displayArgs.contains(QLatin1String("forcepremultiplied"), Qt::CaseInsensitive); + DFBSurfaceDescription description; memset(&description, 0, sizeof(DFBSurfaceDescription)); IDirectFBSurface *surface; @@ -1167,7 +1169,7 @@ bool QDirectFBScreen::connect(const QString &displaySpec) description.caps |= capabilities[i].cap; } - if (displayArgs.contains(QLatin1String("forcepremultiplied"), Qt::CaseInsensitive)) { + if (forcePremultiplied) { description.caps |= DSCAPS_PREMULTIPLIED; } @@ -1217,6 +1219,8 @@ bool QDirectFBScreen::connect(const QString &displaySpec) d_ptr->alphaPixmapFormat = QImage::Format_ARGB32_Premultiplied; break; case QImage::Format_ARGB32: + if (forcePremultiplied) + d_ptr->alphaPixmapFormat = pixelFormat = QImage::Format_ARGB32_Premultiplied; case QImage::Format_ARGB32_Premultiplied: case QImage::Format_ARGB4444_Premultiplied: case QImage::Format_ARGB8555_Premultiplied: -- cgit v0.12