From ad451beae2504666dfe5aeecdd15726f707cd93a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 22 Dec 2012 23:40:20 +0100 Subject: [PATCH] support brightness > 1 for XRender backend REVIEW: 107854 --- scene_xrender.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scene_xrender.cpp b/scene_xrender.cpp index 4ee755aef4..019ddbd261 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -701,9 +701,10 @@ XRenderComposite(display(), PictOpOver, _PART_->x11PictureHandle(), decorationAl } #undef RENDER_DECO_PART - if (data.brightness() < 1.0) { + if (data.brightness() != 1.0) { // fake brightness change by overlaying black - XRenderColor col = { 0, 0, 0, static_cast(0xffff *(1 - data.brightness()) * data.opacity()) }; + const float alpha = (1 - data.brightness()) * data.opacity(); + XRenderColor col = preMultiply(data.brightness() < 1.0 ? QColor(0,0,0,255*alpha) : QColor(255,255,255,-alpha*255)); if (blitInTempPixmap) { XRenderFillRectangle(display(), PictOpOver, renderTarget, &col, -temp_visibleRect.left(), -temp_visibleRect.top(), width(), height());