gallium: replace pipe_buffer_destroy() call with pipe_buffer_reference(NULL)
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 8 May 2008 23:13:01 +0000 (17:13 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 8 May 2008 23:13:01 +0000 (17:13 -0600)
src/mesa/state_tracker/st_cb_drawpixels.c

index 61cbd9e587e0f5b1e52850b26af89cedb001c67c..43e00e6acc2096d1587863a73922f51bcf9d84de 100644 (file)
@@ -484,7 +484,7 @@ draw_quad(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z,
       ubyte *map;
 
       /* allocate/load buffer object with vertex data */
-      buf = pipe_buffer_create(pipe,32, PIPE_BUFFER_USAGE_VERTEX,
+      buf = pipe_buffer_create(pipe, 32, PIPE_BUFFER_USAGE_VERTEX,
                                sizeof(verts));
       map = pipe_buffer_map(pipe, buf, PIPE_BUFFER_USAGE_CPU_WRITE);
       memcpy(map, verts, sizeof(verts));
@@ -494,8 +494,7 @@ draw_quad(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z,
                               PIPE_PRIM_QUADS,
                               4,  /* verts */
                               3); /* attribs/vert */
-
-      pipe_buffer_destroy(pipe, buf);
+      pipe_buffer_reference(pipe->winsys, &buf, NULL);
    }
 }
 
@@ -602,8 +601,10 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
    x1 = x + width * ctx->Pixel.ZoomX;
    y0 = y;
    y1 = y + height * ctx->Pixel.ZoomY;
+   //if(!color)
    draw_quad(ctx, x0, y0, z, x1, y1, color, invertTex);
-
+   //else
+   //printf("skip draw quad\n");
    /* restore state */
    cso_restore_rasterizer(cso);
    cso_restore_viewport(cso);