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