support brightness > 1 for XRender backend

REVIEW: 107854
icc-effect-5.14.5
Thomas Lübking 2012-12-22 23:40:20 +01:00
parent cfda9e240d
commit 7ca47bdd36
1 changed files with 3 additions and 2 deletions

View File

@ -681,9 +681,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<unsigned short>(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());