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 }