diff options
author | Michel Dänzer <[email protected]> | 2009-02-18 18:13:44 +0100 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2009-02-18 18:13:44 +0100 |
commit | c738edcc68905fb251cf9edc0529e2e1c778fdee (patch) | |
tree | 56c903e98a82dc0abc01e1874d190a8f12a3dbf0 /src/gallium/drivers/trace/tr_texture.c | |
parent | aba88b7ed7a1346adada9532aed9633617eb3b6d (diff) |
gallium: Fix up trace driver for introduction of struct pipe_transfer.
Diffstat (limited to 'src/gallium/drivers/trace/tr_texture.c')
-rw-r--r-- | src/gallium/drivers/trace/tr_texture.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gallium/drivers/trace/tr_texture.c b/src/gallium/drivers/trace/tr_texture.c index 1cc4f0bd436..120ba0dd317 100644 --- a/src/gallium/drivers/trace/tr_texture.c +++ b/src/gallium/drivers/trace/tr_texture.c @@ -109,3 +109,43 @@ trace_surface_destroy(struct trace_texture *tr_tex, FREE(tr_surf); } + +struct pipe_transfer * +trace_transfer_create(struct trace_texture *tr_tex, + struct pipe_transfer *transfer) +{ + struct trace_transfer *tr_trans; + + if(!transfer) + goto error; + + assert(transfer->texture == tr_tex->texture); + + tr_trans = CALLOC_STRUCT(trace_transfer); + if(!tr_trans) + goto error; + + memcpy(&tr_trans->base, transfer, sizeof(struct pipe_transfer)); + + tr_trans->base.texture = NULL; + pipe_texture_reference(&tr_trans->base.texture, &tr_tex->base); + tr_trans->transfer = transfer; + + return &tr_trans->base; + +error: + pipe_transfer_reference(&transfer, NULL); + return NULL; +} + + +void +trace_transfer_destroy(struct trace_texture *tr_tex, + struct pipe_transfer *transfer) +{ + struct trace_transfer *tr_trans = trace_transfer(tr_tex, transfer); + pipe_texture_reference(&tr_trans->base.texture, NULL); + pipe_transfer_reference(&tr_trans->transfer, NULL); + FREE(tr_trans); +} + |