b->frontxrb->drawable = d;
b->frontxrb->pixmap = (XMesaPixmap) d;
_mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_FRONT_LEFT,
- &b->frontxrb->Base);
+ &b->frontxrb->Base.Base);
/*
* Back renderbuffer
b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP;
_mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_BACK_LEFT,
- &b->backxrb->Base);
+ &b->backxrb->Base.Base);
}
/*
{
struct gl_renderbuffer *rb
= b->mesa_buffer.Attachment[BUFFER_DEPTH].Renderbuffer;
- if (!rb || !rb->Buffer) {
+ struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
+
+ if (!xrb || !xrb->Base.Buffer) {
*width = 0;
*height = 0;
*bytesPerValue = 0;
*height = b->mesa_buffer.Height;
*bytesPerValue = b->mesa_buffer.Visual.depthBits <= 16
? sizeof(GLushort) : sizeof(GLuint);
- *buffer = (void *) rb->Buffer;
+ *buffer = (void *) xrb->Base.Buffer;
return GL_TRUE;
}
}
struct xmesa_renderbuffer *xrb = CALLOC_STRUCT(xmesa_renderbuffer);
if (xrb) {
GLuint name = 0;
- _mesa_init_renderbuffer(&xrb->Base, name);
+ _mesa_init_renderbuffer(&xrb->Base.Base, name);
- xrb->Base.Delete = xmesa_delete_renderbuffer;
+ xrb->Base.Base.Delete = xmesa_delete_renderbuffer;
if (backBuffer)
- xrb->Base.AllocStorage = xmesa_alloc_back_storage;
+ xrb->Base.Base.AllocStorage = xmesa_alloc_back_storage;
else
- xrb->Base.AllocStorage = xmesa_alloc_front_storage;
+ xrb->Base.Base.AllocStorage = xmesa_alloc_front_storage;
- xrb->Base.InternalFormat = GL_RGBA;
- xrb->Base._BaseFormat = GL_RGBA;
- xrb->Base.ClassID = XMESA_RENDERBUFFER;
+ xrb->Base.Base.InternalFormat = GL_RGBA;
+ xrb->Base.Base._BaseFormat = GL_RGBA;
+ xrb->Base.Base.ClassID = XMESA_RENDERBUFFER;
switch (xmvis->undithered_pf) {
case PF_8R8G8B:
/* This will really only happen for pixmaps. We'll access the
* pixmap via a temporary XImage which will be 32bpp.
*/
- xrb->Base.Format = MESA_FORMAT_XRGB8888;
+ xrb->Base.Base.Format = MESA_FORMAT_XRGB8888;
break;
case PF_8A8R8G8B:
- xrb->Base.Format = MESA_FORMAT_ARGB8888;
+ xrb->Base.Base.Format = MESA_FORMAT_ARGB8888;
break;
case PF_8A8B8G8R:
- xrb->Base.Format = MESA_FORMAT_RGBA8888_REV;
+ xrb->Base.Base.Format = MESA_FORMAT_RGBA8888_REV;
break;
case PF_5R6G5B:
- xrb->Base.Format = MESA_FORMAT_RGB565;
+ xrb->Base.Base.Format = MESA_FORMAT_RGB565;
break;
default:
_mesa_warning(ctx, "Bad pixel format in xmesa_new_renderbuffer");
- xrb->Base.Format = MESA_FORMAT_ARGB8888;
+ xrb->Base.Base.Format = MESA_FORMAT_ARGB8888;
break;
}
{
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
- if (xrb->Base.ClassID == XMESA_RENDERBUFFER) {
+ if (xrb->Base.Base.ClassID == XMESA_RENDERBUFFER) {
XImage *ximage = xrb->ximage;
assert(!xrb->map_mode); /* only a single mapping allowed */
{
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
- if (xrb->Base.ClassID == XMESA_RENDERBUFFER) {
+ if (xrb->Base.Base.ClassID == XMESA_RENDERBUFFER) {
XImage *ximage = xrb->ximage;
if (!ximage) {
assert(xmbuf->cleargc);
XMesaFillRectangle( xmesa->display, xrb->pixmap, xmbuf->cleargc,
- x, xrb->Base.Height - y - height,
+ x, xrb->Base.Base.Height - y - height,
width, height );
}
| ((pixel << 24) & 0xff000000);
}
- if (width == xrb->Base.Width && height == xrb->Base.Height) {
+ if (width == xrb->Base.Base.Width && height == xrb->Base.Base.Height) {
/* clearing whole buffer */
- const GLuint n = xrb->Base.Width * xrb->Base.Height;
+ const GLuint n = xrb->Base.Base.Width * xrb->Base.Base.Height;
GLuint *ptr4 = (GLuint *) xrb->ximage->data;
if (pixel == 0) {
/* common case */
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
if (xrb &&
xrb->pixmap && /* drawing to pixmap or window */
- _mesa_get_format_bits(xrb->Base.Format, GL_ALPHA_BITS) == 0) {
+ _mesa_get_format_bits(xrb->Base.Base.Format, GL_ALPHA_BITS) == 0) {
return GL_TRUE;
}
}
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
if (xrb &&
xrb->pixmap && /* drawing to pixmap or window */
- _mesa_get_format_bits(xrb->Base.Format, GL_ALPHA_BITS) == 0) {
+ _mesa_get_format_bits(xrb->Base.Base.Format, GL_ALPHA_BITS) == 0) {
return GL_TRUE;
}
}
#include "xmesa.h"
#include "main/mtypes.h"
+#include "swrast/s_context.h"
extern _glthread_Mutex _xmesa_lock;
*/
struct xmesa_renderbuffer
{
- struct gl_renderbuffer Base; /* Base class */
+ struct swrast_renderbuffer Base; /* Base class */
XMesaBuffer Parent; /**< The XMesaBuffer this renderbuffer belongs to */
XMesaDrawable drawable; /* Usually the X window ID */