From 29b36c87dd629bd915a105cfbc3b287cf893a394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 29 Jan 2013 09:28:53 +0100 Subject: [PATCH] Port Resize effect to XCB render --- effects/resize/resize.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/effects/resize/resize.cpp b/effects/resize/resize.cpp index 990d283d9f..02bef0d756 100644 --- a/effects/resize/resize.cpp +++ b/effects/resize/resize.cpp @@ -24,8 +24,7 @@ along with this program. If not, see . #include #ifdef KWIN_HAVE_XRENDER_COMPOSITING -#include -#include +#include #endif #include @@ -108,14 +107,18 @@ void ResizeEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Window #ifdef KWIN_HAVE_XRENDER_COMPOSITING if (effects->compositingType() == XRenderCompositing) { - XRenderColor col; + xcb_render_color_t col; 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, paintRegion.rects()) - XRenderFillRectangle(display(), PictOpOver, effects->xrenderBufferPicture(), - &col, r.x(), r.y(), r.width(), r.height()); + QVector rects; + foreach (const QRect & r, paintRegion.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 }