XMesaDrawable window,
XMesaColormap cmap )
{
-#if NEW_RENDERBUFFER
struct xmesa_renderbuffer *front_xrb, *back_xrb;
-#endif
#ifndef XFree86Server
XGCValues gcvalues;
#endif
assert(b->xm_visual == v);
}
-#if NEW_RENDERBUFFER
if (b) {
front_xrb = b->frontxrb;
back_xrb = b->backxrb;
else {
front_xrb = back_xrb = NULL;
}
-#endif
/* Save true bits/pixel */
v->BitsPerPixel = bits_per_pixel(v);
*/
void XMesaResizeBuffers( XMesaBuffer b )
{
-#if OLD_RENDERBUFFER
- xmesa_resize_buffers(ctx, &(b->mesa_buffer), 0, 0 );
-#endif
+ Window root;
+ int xpos, ypos;
+ unsigned int width, height, bw, depth;
+ GET_CURRENT_CONTEXT(ctx);
+ XGetGeometry( b->xm_visual->display, b->frontxrb->pixmap,
+ &root, &xpos, &ypos, &width, &height, &bw, &depth);
+ xmesa_resize_buffers(ctx, &(b->mesa_buffer), width, height);
}
xmesa_alloc_back_buffer(xmBuffer, width, height);
-#if NEW_RENDERBUFFER
_mesa_resize_framebuffer(ctx, buffer, width, height);
-#endif
}
}
}
-#if OLD_RENDERBUFFER && 0
- if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) {
- xmesa_update_span_funcs(ctx);
- }
-#endif
-
if (xmesa->xm_visual->hpcr_clear_flag) {
/* this depends on whether we're drawing to the front or back buffer */
/* XXX FIX THIS! */
#define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1)
-/* XXX these are temporary */
-#define NEW_RENDERBUFFER 1
-#define OLD_RENDERBUFFER 0
+/* XXX everything marked with OLD_RENDERBUFFER will be going away... */
+#define OLD_RENDERBUFFER 1
#endif /* CONFIG_H */
if (drawBuffer && readBuffer) {
/* TODO: check if newCtx and buffer's visual match??? */
-#if NEW_RENDERBUFFER
ASSERT(drawBuffer->Name == 0);
ASSERT(readBuffer->Name == 0);
newCtx->WinSysDrawBuffer = drawBuffer;
newCtx->DrawBuffer = drawBuffer;
newCtx->ReadBuffer = readBuffer;
}
-#else
- newCtx->DrawBuffer = drawBuffer;
- newCtx->ReadBuffer = readBuffer;
-#endif
+
newCtx->NewState |= _NEW_BUFFERS;
#if _HAVE_FULL_GL
struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS][4];
struct gl_renderbuffer *_ColorReadBuffer;
-#if OLD_RENDERBUFFER || NEW_RENDERBUFFER
+#if OLD_RENDERBUFFER
/* XXX THIS IS TEMPORARY */
GLuint _ColorDrawBit[MAX_DRAW_BUFFERS][4];
#endif
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers[0]; i++) {
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][i];
-#if OLD_RENDERBUFFER || NEW_RENDERBUFFER
+#if OLD_RENDERBUFFER
/* SetBuffer will go away */
if (swrast->Driver.SetBuffer)
swrast->Driver.SetBuffer(ctx, ctx->DrawBuffer,
* MULTI_DRAW_BIT flag. Also set it if we're drawing to no
* buffers or the RGBA or CI mask disables all writes.
*/
-#if NEW_RENDERBUFFER
if (ctx->DrawBuffer->_NumColorDrawBuffers[0] != 1) {
-#endif
/* more than one color buffer designated for writing (or zero buffers) */
rasterMask |= MULTI_DRAW_BIT;
}
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels)
{
-#if NEW_RENDERBUFFER
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];
-#endif
SWcontext *swrast = SWRAST_CONTEXT(ctx);
struct sw_span span;
_swrast_read_rgba_span(ctx, rb, span->end, span->x, span->y, dest);
}
- /* NEW_RENDERBUFFER: XXX make this a runtime test */
+ /* XXX make this a runtime test */
#if CHAN_TYPE == GL_UNSIGNED_BYTE
/* treat 4*GLubyte as GLuint */
logicop_uint(ctx, span->end, (GLuint *) rgba,
}
}
-#if OLD_RENDERBUFFER || NEW_RENDERBUFFER
+#if OLD_RENDERBUFFER
/* restore default dest buffer */
_swrast_use_draw_buffer(ctx);
#endif
static void
multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
{
-#if OLD_RENDERBUFFER || NEW_RENDERBUFFER
+#if OLD_RENDERBUFFER
SWcontext *swrast = SWRAST_CONTEXT(ctx);
#endif
const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][i];
GLchan rgbaTmp[MAX_WIDTH][4];
-#if OLD_RENDERBUFFER || NEW_RENDERBUFFER
+#if OLD_RENDERBUFFER
/* obsolete code */
GLuint bufferBit = fb->_ColorDrawBit[output][i];
/* Set the current read/draw buffer */
}
}
-#if OLD_RENDERBUFFER || NEW_RENDERBUFFER
+#if OLD_RENDERBUFFER
/* restore default dest buffer */
_swrast_use_draw_buffer(ctx);
#endif
* Unless otherwise noted, all functions are mandatory.
*/
struct swrast_device_driver {
-#if OLD_RENDERBUFFER || NEW_RENDERBUFFER
+#if OLD_RENDERBUFFER
void (*SetBuffer)(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit);
/*
* Specifies the current color buffer for span/pixel writing/reading.