From 6acbf6dce98903310023284e27a65c19f9a829bc Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 16 Sep 2010 23:58:56 +0000 Subject: Make SourceOver work properly in Qt/DirectFB Qt and DirectFB have different definitions of SourceOver. In DirectFB it's defined as this: /* pixel = (source * fs + destination * fd), sa = source alpha, da = destination alpha */ DSPD_SRC_OVER = 3, /* fs: 1.0 fd: 1.0-sa */ In other words, the source pixels are not multiplied by the alpha and this leads to issues with RGBA values like 255, 0, 0, 0. The composition mode that in DirectFB that maps onto Qt's CompositionMode_SourceOver is DSPD_NONE, defined like this: DSPD_NONE = 0, /* fs: sa fd: 1.0-sa (defaults) */ Merge-request: 807 Reviewed-by: Donald Carr --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index d5f0d42..4869eba 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -978,7 +978,7 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m break; case QPainter::CompositionMode_SourceOver: compositionModeStatus &= ~PorterDuff_AlwaysBlend; - surface->SetPorterDuff(surface, DSPD_SRC_OVER); + surface->SetPorterDuff(surface, DSPD_NONE); break; case QPainter::CompositionMode_DestinationOver: surface->SetPorterDuff(surface, DSPD_DST_OVER); -- cgit v0.12