From e4d54bd4de90c1959eac438336d2c318fab345b4 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Thu, 27 Nov 2008 13:20:26 +0000 Subject: [PATCH] Implement XRender shadow brightness. svn path=/trunk/KDE/kdebase/workspace/; revision=889724 --- effects/shadow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/effects/shadow.cpp b/effects/shadow.cpp index 7a0d22508b..5336cadb94 100644 --- a/effects/shadow.cpp +++ b/effects/shadow.cpp @@ -642,6 +642,13 @@ void ShadowEffect::drawShadowQuadXRender( XRenderPicture *picture, QRect rect, f XRenderComposite( display(), PictOpOver, *picture, fill, effects->xrenderBufferPicture(), 0, 0, 0, 0, rect.x(), rect.y(), rect.width(), rect.height() ); + // Fake brightness by overlaying black + // Cannot use XRenderFillRectangle() due to ARGB + XRenderColor col = { 0, 0, 0, 0xffff * ( 1 - brightness ) * opacity }; + fill = xRenderFill( &col ); + XRenderComposite( display(), PictOpOver, fill, *picture, effects->xrenderBufferPicture(), 0, 0, 0, 0, + rect.x(), rect.y(), rect.width(), rect.height() ); + // Return to scale to 1.0 if( xScale != 1.0 || yScale != 1.0 ) {