Remove NEW_RENDERBUFFER stuff.
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 1 Jul 2005 01:22:25 +0000 (01:22 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 1 Jul 2005 01:22:25 +0000 (01:22 +0000)
Now, OLD_RENDERBUFFER marks code that needs to eventually be removed when
all the drivers are updated to no longer need the SetBuffer() function.

src/mesa/drivers/x11/xm_api.c
src/mesa/drivers/x11/xm_dd.c
src/mesa/main/config.h
src/mesa/main/context.c
src/mesa/main/mtypes.h
src/mesa/swrast/s_buffers.c
src/mesa/swrast/s_context.c
src/mesa/swrast/s_drawpix.c
src/mesa/swrast/s_logic.c
src/mesa/swrast/s_span.c
src/mesa/swrast/swrast.h

index f710a298664c1a85d980142ec1cf2b761180d9eb..bd8b9e6c7b3035924b9b4011b056dec9f8122dd4 100644 (file)
@@ -1204,9 +1204,7 @@ static GLboolean initialize_visual_and_buffer( int client,
                                                XMesaDrawable window,
                                                XMesaColormap cmap )
 {
-#if NEW_RENDERBUFFER
    struct xmesa_renderbuffer *front_xrb, *back_xrb;
-#endif
 #ifndef XFree86Server
    XGCValues gcvalues;
 #endif
@@ -1215,7 +1213,6 @@ static GLboolean initialize_visual_and_buffer( int client,
       assert(b->xm_visual == v);
    }
 
-#if NEW_RENDERBUFFER
    if (b) {
       front_xrb = b->frontxrb;
       back_xrb = b->backxrb;
@@ -1223,7 +1220,6 @@ static GLboolean initialize_visual_and_buffer( int client,
    else {
       front_xrb = back_xrb = NULL;
    }
-#endif
 
    /* Save true bits/pixel */
    v->BitsPerPixel = bits_per_pixel(v);
@@ -2637,8 +2633,12 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
  */
 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);
 }
 
index 201880d5cc823026a5b1cecc3bad8908bbe1f988..7ab09d444d6458fb6fc24bacc6f2eb910dd0ae36 100644 (file)
@@ -563,9 +563,7 @@ xmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer,
 
    xmesa_alloc_back_buffer(xmBuffer, width, height);
 
-#if NEW_RENDERBUFFER
    _mesa_resize_framebuffer(ctx, buffer, width, height);
-#endif
 }
 
 
@@ -1022,12 +1020,6 @@ xmesa_update_state( GLcontext *ctx, GLuint new_state )
       }
    }
 
-#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! */
index 476ed63aadcbc40c19afe50a7d207999b983bdd8..719c68e30008de189fac6afbe29c10372254801d 100644 (file)
 #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 */
index 2c444c80d8a116ebc9672ab5dd7bb9e0c946290f..ba8a456248c88b22a68c53cd804e58dfab313548 100644 (file)
@@ -1555,7 +1555,6 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
       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;
@@ -1565,10 +1564,7 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
             newCtx->DrawBuffer = drawBuffer;
             newCtx->ReadBuffer = readBuffer;
          }
-#else
-        newCtx->DrawBuffer = drawBuffer;
-        newCtx->ReadBuffer = readBuffer;
-#endif
+
         newCtx->NewState |= _NEW_BUFFERS;
 
 #if _HAVE_FULL_GL
index 1733c43bce0f118397c7bc88197c62c482149d14..655e30336af9df0f6d0cdd2f3f8ec528d4ec86f1 100644 (file)
@@ -2184,7 +2184,7 @@ struct gl_framebuffer
    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
index e7889008972c34803f08117afd873407c9adc436..7af9d9d5134090c56407d5b295c1ddfc11a8543d 100644 (file)
@@ -234,7 +234,7 @@ clear_color_buffers(GLcontext *ctx)
 
    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,
index 4a4d1b880a3ea2073a106042e600faf3c68f73b9..5c57b42d6cbe2dd900ef848ffb1388062b27479f 100644 (file)
@@ -88,9 +88,7 @@ _swrast_update_rasterflags( GLcontext *ctx )
     * 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;
    }
index 9d231472c2162d8911b05314654293c026d89585..709f9a13c71c8a1ebe90d3afb0ccb9f678dc2360 100644 (file)
@@ -51,9 +51,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
                  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;
 
index 56bc01203a84e2dde8156d7c9da97ca48e16462d..05e2e0ade4755e941d88a896020c3199d7c33b87 100644 (file)
@@ -224,7 +224,7 @@ _swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
       _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,
index 3a6e7195b1bc63729d21bda1c335e9a6beee111b..aec9a99912760d3b026f649db6274ffd6a41c5c8 100644 (file)
@@ -987,7 +987,7 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span)
       }
    }
 
-#if OLD_RENDERBUFFER || NEW_RENDERBUFFER
+#if OLD_RENDERBUFFER
    /* restore default dest buffer */
    _swrast_use_draw_buffer(ctx);
 #endif
@@ -1033,7 +1033,7 @@ add_colors(GLuint n, GLchan rgba[][4], GLchan specular[][4] )
 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);
@@ -1048,7 +1048,7 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
       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 */
@@ -1085,7 +1085,7 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
       }
    }
 
-#if OLD_RENDERBUFFER || NEW_RENDERBUFFER
+#if OLD_RENDERBUFFER
    /* restore default dest buffer */
    _swrast_use_draw_buffer(ctx);
 #endif
index 3aa30d35318697f7e9865286e0642d03e1368282..299eda5dc3ef59d2278061220dc9259b23652563 100644 (file)
@@ -257,7 +257,7 @@ _swrast_copy_texsubimage3d(GLcontext *ctx,
  * 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.