From cd1eab0c55b8bcb71bc2dee79ba20955a52aa853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 29 Jan 2013 09:25:14 +0100 Subject: [PATCH] Port ShowPaint Effect to XCB render --- effects/showpaint/showpaint.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/effects/showpaint/showpaint.cpp b/effects/showpaint/showpaint.cpp index 4cbd9ae6c7..1630a73a7c 100644 --- a/effects/showpaint/showpaint.cpp +++ b/effects/showpaint/showpaint.cpp @@ -25,8 +25,7 @@ along with this program. If not, see . #include #ifdef KWIN_HAVE_XRENDER_COMPOSITING -#include -#include +#include #endif #include @@ -100,16 +99,19 @@ void ShowPaintEffect::paintGL() void ShowPaintEffect::paintXrender() { #ifdef KWIN_HAVE_XRENDER_COMPOSITING - XRenderColor col; + xcb_render_color_t col; float alpha = 0.2; const QColor& color = colors[ color_index ]; col.alpha = int(alpha * 0xffff); col.red = int(alpha * 0xffff * color.red() / 255); col.green = int(alpha * 0xffff * color.green() / 255); col.blue = int(alpha * 0xffff * color.blue() / 255); - foreach (const QRect & r, painted.rects()) - XRenderFillRectangle(display(), PictOpOver, effects->xrenderBufferPicture(), - &col, r.x(), r.y(), r.width(), r.height()); + QVector rects; + foreach (const QRect & r, painted.rects()) { + xcb_rectangle_t rect = {int16_t(r.x()), int16_t(r.y()), uint16_t(r.width()), uint16_t(r.height())}; + rects << rect; + } + xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_OVER, effects->xrenderBufferPicture(), col, rects.count(), rects.constData()); #endif }