From 022d2066c6ce9737a8bb53d701aec6f32e9a60a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 8 May 2008 19:08:05 +0000 Subject: [PATCH] Implement fake brightness by overlaying black over the window. Makes Logout or DimInactive effects work in XRender mode too. svn path=/trunk/KDE/kdebase/workspace/; revision=805577 --- COMPOSITE_TODO | 2 -- scene_xrender.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/COMPOSITE_TODO b/COMPOSITE_TODO index 0659378611..8312334471 100644 --- a/COMPOSITE_TODO +++ b/COMPOSITE_TODO @@ -150,8 +150,6 @@ OpenGL TODO XRender TODO ============================== -+ SceneXrender::Window::performPaint() doesn't use brightness - + SceneXrender::paintTransformedScreen() doesn't handle properly extending of painted area in window's pre-paint - see the transformedShape() comment - and currently seems to be generally broken diff --git a/scene_xrender.cpp b/scene_xrender.cpp index 6c9614708b..097155ea51 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -516,12 +516,18 @@ void SceneXrender::Window::performPaint( int mask, QRegion region, WindowPaintDa { XRenderComposite( display(), PictOpSrc, pic, None, buffer, 0, 0, 0, 0, x, y, width, height); + // fake brightness change by overlaying black + XRenderColor col = { 0, 0, 0, 0xffff * ( 1 - data.brightness ) }; + XRenderFillRectangle( display(), PictOpOver, buffer, &col, x, y, width, height ); } else { Picture alpha = alphaMask( data.opacity ); XRenderComposite( display(), PictOpOver, pic, alpha, buffer, 0, 0, 0, 0, x, y, width, height); + // fake brightness change by overlaying black + XRenderColor col = { 0, 0, 0, 0xffff * ( 1 - data.brightness ) * data.opacity }; + XRenderFillRectangle( display(), PictOpOver, buffer, &col, x, y, width, height ); transformed_shape = QRegion(); } }