summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-04-09 16:34:14 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-04-09 16:34:14 (GMT)
commitb106ddb649ec0260486755ff7a87bbdc719785d1 (patch)
treed9682bfe53d7638a0c839949715a217ed43bc65f /src/plugins/gfxdrivers
parent405f78f8e1ef68ebce2abd790820438c9e420755 (diff)
downloadQt-b106ddb649ec0260486755ff7a87bbdc719785d1.zip
Qt-b106ddb649ec0260486755ff7a87bbdc719785d1.tar.gz
Qt-b106ddb649ec0260486755ff7a87bbdc719785d1.tar.bz2
Fix setOpacity
Opacity doesn't play well with PorterDuff so we need to disable the porter duff when opacity is set. Also the DSBLIT_SRC_PREMULTCOLOR flag is not the right thing for us. Reviewed-by: TrustMe
Diffstat (limited to 'src/plugins/gfxdrivers')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 24d77bf..a8fdff8 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -440,10 +440,9 @@ void QDirectFBPaintEnginePrivate::setOpacity(quint8 op)
{
opacity = op;
if (opacity == 255) {
- // ### need to check this stuff
- blitFlagsFromCompositionMode &= ~(DSBLIT_BLEND_COLORALPHA | DSBLIT_SRC_PREMULTCOLOR);
+ blitFlagsFromCompositionMode &= ~DSBLIT_BLEND_COLORALPHA;
} else {
- blitFlagsFromCompositionMode |= (DSBLIT_BLEND_COLORALPHA | DSBLIT_SRC_PREMULTCOLOR);
+ blitFlagsFromCompositionMode |= DSBLIT_BLEND_COLORALPHA;
}
}
@@ -459,11 +458,14 @@ void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints)
void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha)
{
quint32 blittingFlags = blitFlagsFromCompositionMode;
- if (!alpha) {
+ if (alpha) {
+ surface->SetPorterDuff(surface,
+ (blittingFlags & DSBLIT_BLEND_COLORALPHA)
+ ? DSPD_NONE
+ : porterDuffRule);
+ } else {
blittingFlags &= ~DSBLIT_BLEND_ALPHACHANNEL;
surface->SetPorterDuff(surface, DSPD_NONE);
- } else {
- surface->SetPorterDuff(surface, porterDuffRule);
}
surface->SetColor(surface, 0xff, 0xff, 0xff, opacity);
surface->SetBlittingFlags(surface, DFBSurfaceBlittingFlags(blittingFlags));