/** Fill a rectangle on the appropriate screen by combining the color * with the dest picture in the area specified by the list of * rectangles. For a complete description see the protocol document of * the RENDER library. */ void dmxCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects) { ScreenPtr pScreen = pDst->pDrawable->pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps = GetPictureScreen(pScreen); dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pDst); DMX_UNWRAP(CompositeRects, dmxScreen, ps); #if 0 if (ps->CompositeRects) ps->CompositeRects(op, pDst, color, nRect, rects); #endif /* CompositeRects on back-end server */ if (pPictPriv->pict) { XRenderFillRectangles(dmxScreen->beDisplay, op, pPictPriv->pict, (XRenderColor *) color, (XRectangle *) rects, nRect); dmxSync(dmxScreen, FALSE); } DMX_WRAP(CompositeRects, dmxCompositeRects, dmxScreen, ps); }
static void set_pixel(Display *dpy, Picture picture, int x, int y, GLfloat *color) { XRectangle rect = {x, y, 1, 1}; XRenderColor render_color; render_color.red = 0xffff * color[0]; render_color.green = 0xffff * color[1]; render_color.blue = 0xffff * color[2]; render_color.alpha = 0xffff * color[3]; XRenderFillRectangles(dpy, PictOpSrc, picture, &render_color, &rect, 1); }
void QXcbNativeBackingStore::beginPaint(const QRegion ®ion) { #if QT_CONFIG(xrender) if (m_translucentBackground) { const QVector<XRectangle> xrects = qt_region_to_xrectangles(region); const XRenderColor color = { 0, 0, 0, 0 }; XRenderFillRectangles(display(), PictOpSrc, qt_x11PictureHandle(m_pixmap), &color, xrects.constData(), xrects.size()); } #else Q_UNUSED(region); #endif }
void MouseMarkEffect::addRect(const QPoint &p1, const QPoint &p2, XRectangle *r, XRenderColor *c) { r->x = qMin(p1.x(), p2.x()) - width_2; r->y = qMin(p1.y(), p2.y()) - width_2; r->width = qAbs(p1.x()-p2.x()) + 1 + width_2; r->height = qAbs(p1.y()-p2.y()) + 1 + width_2; // fast move -> large rect, <strike>tess...</strike> interpolate a line if (r->width > 3*width/2 && r->height > 3*width/2) { const int n = sqrt(r->width*r->width + r->height*r->height) / width; XRectangle *rects = new XRectangle[n-1]; const int w = p1.x() < p2.x() ? r->width : -r->width; const int h = p1.y() < p2.y() ? r->height : -r->height; for (int i = 1; i < n; ++i) { rects[i-1].x = p1.x() + i*w/n; rects[i-1].y = p1.y() + i*h/n; rects[i-1].width = rects[i-1].height = width; } XRenderFillRectangles(display(), PictOpSrc, effects->xrenderBufferPicture(), c, rects, n - 1); delete [] rects; r->x = p1.x(); r->y = p1.y(); r->width = r->height = width; } }