DRI2Buffer *ephyrDRI2GetBuffersWithFormat(XID drawable, int *width, int *height, unsigned int *attachments, int count, int *out_count) { Display *dpy = hostx_get_display (); return DRI2GetBuffersWithFormat(dpy, drawable, width, height, attachments, count, out_count); }
/** * Get the buffers of the DRI2 drawable. The returned array should be freed. */ struct x11_drawable_buffer * x11_drawable_get_buffers(struct x11_screen *xscr, Drawable drawable, int *width, int *height, unsigned int *attachments, boolean with_format, int num_ins, int *num_outs) { DRI2Buffer *dri2bufs; if (with_format) dri2bufs = DRI2GetBuffersWithFormat(xscr->dpy, drawable, width, height, attachments, num_ins, num_outs); else dri2bufs = DRI2GetBuffers(xscr->dpy, drawable, width, height, attachments, num_ins, num_outs); return (struct x11_drawable_buffer *) dri2bufs; }
static int ProcDRI2GetBuffersWithFormat(ClientPtr client) { REQUEST(xDRI2GetBuffersReq); DrawablePtr pDrawable; DRI2BufferPtr *buffers; int status, width, height, count; unsigned int *attachments; REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * (2 * 4)); if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) return status; if (DRI2ThrottleClient(client, pDrawable)) return Success; attachments = (unsigned int *) &stuff[1]; buffers = DRI2GetBuffersWithFormat(pDrawable, &width, &height, attachments, stuff->count, &count); return send_buffers_reply(client, pDrawable, buffers, count, width, height); }
static __DRIbuffer * dri2GetBuffersWithFormat(__DRIdrawable * driDrawable, int *width, int *height, unsigned int *attachments, int count, int *out_count, void *loaderPrivate) { __GLXDRIdrawablePrivate *pdraw = loaderPrivate; DRI2Buffer *buffers; buffers = DRI2GetBuffersWithFormat(pdraw->base.psc->dpy, pdraw->base.xDrawable, width, height, attachments, count, out_count); if (buffers == NULL) return NULL; pdraw->width = *width; pdraw->height = *height; process_buffers(pdraw, buffers, *out_count); Xfree(buffers); return pdraw->buffers; }