Lines Matching refs:xrb
256 struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
259 xrb->origin2 = NULL;
260 xrb->origin3 = NULL;
261 xrb->origin4 = NULL;
264 xrb->bottom = height - 1;
282 struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
285 assert(xrb->Parent);
286 alloc_back_buffer(xrb->Parent, width, height);
293 if (xrb->ximage) {
295 xrb->width2 = xrb->ximage->bytes_per_line / 2;
296 xrb->origin2 = (GLushort *) xrb->ximage->data + xrb->width2 * (height - 1);
299 xrb->width3 = xrb->ximage->bytes_per_line;
300 xrb->origin3 = (GLubyte *) xrb->ximage->data + xrb->width3 * (height - 1);
303 xrb->width4 = xrb->ximage->width;
304 xrb->origin4 = (GLuint *) xrb->ximage->data + xrb->width4 * (height - 1);
308 xrb->width2 = xrb->width3 = xrb->width4 = 0;
309 xrb->origin2 = NULL;
310 xrb->origin3 = NULL;
311 xrb->origin4 = NULL;
326 struct xmesa_renderbuffer *xrb = CALLOC_STRUCT(xmesa_renderbuffer);
327 if (xrb) {
329 _mesa_init_renderbuffer(&xrb->Base.Base, name);
331 xrb->Base.Base.Delete = xmesa_delete_renderbuffer;
333 xrb->Base.Base.AllocStorage = xmesa_alloc_back_storage;
335 xrb->Base.Base.AllocStorage = xmesa_alloc_front_storage;
337 xrb->Base.Base.InternalFormat = GL_RGBA;
338 xrb->Base.Base._BaseFormat = GL_RGBA;
339 xrb->Base.Base.ClassID = XMESA_RENDERBUFFER;
346 xrb->Base.Base.Format = MESA_FORMAT_XRGB8888;
349 xrb->Base.Base.Format = MESA_FORMAT_ARGB8888;
352 xrb->Base.Base.Format = MESA_FORMAT_RGBA8888_REV;
355 xrb->Base.Base.Format = MESA_FORMAT_RGB565;
359 xrb->Base.Base.Format = MESA_FORMAT_ARGB8888;
365 return xrb;
427 struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
429 if (xrb->Base.Base.ClassID == XMESA_RENDERBUFFER) {
430 XImage *ximage = xrb->ximage;
432 assert(!xrb->map_mode); /* only a single mapping allowed */
434 xrb->map_mode = mode;
435 xrb->map_x = x;
436 xrb->map_y = y;
437 xrb->map_w = w;
438 xrb->map_h = h;
452 assert(xrb->pixmap);
461 ximage = XGetImage(xrb->Parent->display,
462 xrb->pixmap, x, y2, w, h,
470 _mesa_format_row_stride(xrb->Base.Base.Format,
471 xrb->Base.Base.Width);
473 xrb->Base.Base.Height);
474 ximage = XCreateImage(xrb->Parent->display,
475 xrb->Parent->xm_visual->visinfo->visual,
476 xrb->Parent->xm_visual->visinfo->depth,
480 xrb->Base.Base.Width,
481 xrb->Base.Base.Height,
492 xrb->map_ximage = ximage;
518 xrb = xmesa_renderbuffer(rb);
520 if (xrb->Base.Base.ClassID == XMESA_RENDERBUFFER) {
521 XImage *ximage = xrb->ximage;
525 assert(xrb->pixmap);
526 assert(xrb->map_ximage);
527 if (xrb->map_ximage) {
528 if (xrb->map_mode & GL_MAP_WRITE_BIT) {
530 int y2 = rb->Height - xrb->map_y - xrb->map_h;
531 GC gc = XCreateGC(xrb->Parent->display, xrb->pixmap, 0, NULL);
533 XPutImage(xrb->Parent->display,
534 xrb->pixmap, /* dest */
536 xrb->map_ximage, /* source */
538 xrb->map_x, y2, /* dest x, y */
539 xrb->map_w, xrb->map_h); /* size */
541 XFreeGC(xrb->Parent->display, gc);
543 XMesaDestroyImage(xrb->map_ximage);
544 xrb->map_ximage = NULL;
548 xrb->map_mode = 0x0;