diff options
author | Brian <brian.paul@tungstengraphics.com> | 2008-02-06 09:29:00 -0700 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2008-02-15 13:50:32 +1100 |
commit | 2a3b31c1c4e73529c93476161973dae13b31aee5 (patch) | |
tree | ecf7e3fae1733df23b7f6efe1a1de7ac0667d843 /src/mesa/pipe/softpipe/sp_state_blend.c | |
parent | 67155e8edff96f0a6e85580b0753041e67d3f99d (diff) |
gallium: use mem_dup()
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_state_blend.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_state_blend.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mesa/pipe/softpipe/sp_state_blend.c b/src/mesa/pipe/softpipe/sp_state_blend.c index 160ca5cbc0..2d40d6bd8f 100644 --- a/src/mesa/pipe/softpipe/sp_state_blend.c +++ b/src/mesa/pipe/softpipe/sp_state_blend.c @@ -32,13 +32,12 @@ #include "sp_context.h" #include "sp_state.h" + void * softpipe_create_blend_state(struct pipe_context *pipe, const struct pipe_blend_state *blend) { - struct pipe_blend_state *state = MALLOC( sizeof(struct pipe_blend_state) ); - memcpy(state, blend, sizeof(struct pipe_blend_state)); - return state; + return mem_dup(blend, sizeof(*blend)); } void softpipe_bind_blend_state( struct pipe_context *pipe, @@ -78,10 +77,7 @@ void * softpipe_create_depth_stencil_state(struct pipe_context *pipe, const struct pipe_depth_stencil_alpha_state *depth_stencil) { - struct pipe_depth_stencil_alpha_state *state = - MALLOC( sizeof(struct pipe_depth_stencil_alpha_state) ); - memcpy(state, depth_stencil, sizeof(struct pipe_depth_stencil_alpha_state)); - return state; + return mem_dup(depth_stencil, sizeof(*depth_stencil)); } void |