summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_accum.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-02-16 19:50:48 +0000
committerKeith Whitwell <keithw@vmware.com>2009-02-16 19:50:48 +0000
commit59d54334c96f44ed1d8bf660dc96221362a77d04 (patch)
treee9ab34e568256bcdc2a88602c47072ab769211e8 /src/mesa/state_tracker/st_cb_accum.c
parent7c8836e9ef49d938aa55a1c385b95c6371c301f1 (diff)
parentc5c383596ddb26cd75e4b355918ad16915283b59 (diff)
Merge branch 'master' into gallium-texture-transfer
Conflicts: src/mesa/state_tracker/st_cb_accum.c src/mesa/state_tracker/st_cb_drawpixels.c
Diffstat (limited to 'src/mesa/state_tracker/st_cb_accum.c')
-rw-r--r--src/mesa/state_tracker/st_cb_accum.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c
index 46ec03234f..33c648856a 100644
--- a/src/mesa/state_tracker/st_cb_accum.c
+++ b/src/mesa/state_tracker/st_cb_accum.c
@@ -210,8 +210,8 @@ accum_accum(struct pipe_context *pipe, GLfloat value,
PIPE_TRANSFER_READ, xpos, ypos,
width, height);
- colorBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ colorBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
+ accBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(color_trans, 0, 0, width, height, colorBuf);
acc_get_tile_rgba(pipe, acc_trans, 0, 0, width, height, accBuf);
@@ -227,10 +227,17 @@ accum_accum(struct pipe_context *pipe, GLfloat value,
acc_put_tile_rgba(pipe, acc_trans, 0, 0, width, height, accBuf);
+<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
free(colorBuf);
free(accBuf);
screen->tex_transfer_release(screen, &acc_trans);
screen->tex_transfer_release(screen, &color_trans);
+=======
+ _mesa_free(colorBuf);
+ _mesa_free(accBuf);
+ pipe_surface_reference(&acc_surf, NULL);
+ pipe_surface_reference(&color_surf, NULL);
+>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
@@ -253,7 +260,7 @@ accum_load(struct pipe_context *pipe, GLfloat value,
PIPE_TRANSFER_READ, xpos, ypos,
width, height);
- buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf);
@@ -263,9 +270,15 @@ accum_load(struct pipe_context *pipe, GLfloat value,
acc_put_tile_rgba(pipe, acc_trans, 0, 0, width, height, buf);
+<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
free(buf);
screen->tex_transfer_release(screen, &acc_trans);
screen->tex_transfer_release(screen, &color_trans);
+=======
+ _mesa_free(buf);
+ pipe_surface_reference(&acc_surf, NULL);
+ pipe_surface_reference(&color_surf, NULL);
+>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
@@ -282,7 +295,7 @@ accum_return(GLcontext *ctx, GLfloat value,
GLfloat *abuf, *cbuf = NULL;
GLint i, ch;
- abuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ abuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
acc_trans = screen->get_tex_transfer(screen, acc_strb->texture, 0, 0, 0,
PIPE_TRANSFER_READ, xpos, ypos,
@@ -295,8 +308,13 @@ accum_return(GLcontext *ctx, GLfloat value,
acc_get_tile_rgba(pipe, acc_trans, 0, 0, width, height, abuf);
if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) {
+<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
cbuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
pipe_get_tile_rgba(color_trans, 0, 0, width, height, cbuf);
+=======
+ cbuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
+ pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, cbuf);
+>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}
for (i = 0; i < width * height; i++) {
@@ -313,11 +331,17 @@ accum_return(GLcontext *ctx, GLfloat value,
pipe_put_tile_rgba(color_trans, 0, 0, width, height, abuf);
- free(abuf);
+ _mesa_free(abuf);
if (cbuf)
+<<<<<<< HEAD:src/mesa/state_tracker/st_cb_accum.c
free(cbuf);
screen->tex_transfer_release(screen, &acc_trans);
screen->tex_transfer_release(screen, &color_trans);
+=======
+ _mesa_free(cbuf);
+ pipe_surface_reference(&acc_surf, NULL);
+ pipe_surface_reference(&color_surf, NULL);
+>>>>>>> master:src/mesa/state_tracker/st_cb_accum.c
}