trace_texture_unwrap(struct trace_context *tr_ctx,
struct pipe_texture *texture)
{
- struct trace_screen *tr_scr = trace_screen(tr_ctx->base.screen);
struct trace_texture *tr_tex;
if(!texture)
return NULL;
- tr_tex = trace_texture(tr_scr, texture);
+ tr_tex = trace_texture(texture);
assert(tr_tex->texture);
- assert(tr_tex->texture->screen == tr_scr->screen);
return tr_tex->texture;
}
struct pipe_surface *surface)
{
struct trace_screen *tr_scr = trace_screen(tr_ctx->base.screen);
- struct trace_texture *tr_tex;
struct trace_surface *tr_surf;
if(!surface)
if(!surface->texture)
return surface;
- tr_tex = trace_texture(tr_scr, surface->texture);
- tr_surf = trace_surface(tr_tex, surface);
+ tr_surf = trace_surface(surface);
assert(tr_surf->surface);
assert(tr_surf->surface->texture->screen == tr_scr->screen);
void trace_dump_texture_ptr(struct pipe_texture *_texture)
{
if (_texture) {
- struct trace_screen *tr_scr = trace_screen(_texture->screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _texture);
+ struct trace_texture *tr_tex = trace_texture(_texture);
trace_dump_ptr(tr_tex->texture);
} else {
trace_dump_null();
void trace_dump_surface_ptr(struct pipe_surface *_surface)
{
if (_surface) {
- struct trace_screen *tr_scr = trace_screen(_surface->texture->screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _surface->texture);
- struct trace_surface *tr_surf = trace_surface(tr_tex, _surface);
+ struct trace_surface *tr_surf = trace_surface(_surface);
trace_dump_ptr(tr_surf->surface);
} else {
trace_dump_null();
void trace_dump_transfer_ptr(struct pipe_transfer *_transfer)
{
if (_transfer) {
- struct trace_screen *tr_scr = trace_screen(_transfer->texture->screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _transfer->texture);
- struct trace_transfer *tr_tran = trace_transfer(tr_tex, _transfer);
+ struct trace_transfer *tr_tran = trace_transfer(_transfer);
trace_dump_ptr(tr_tran->transfer);
} else {
trace_dump_null();
void *context_private)
{
struct trace_screen *tr_scr = trace_screen(_screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _surface->texture);
- struct trace_surface *tr_surf = trace_surface(tr_tex, _surface);
+ struct trace_surface *tr_surf = trace_surface(_surface);
struct pipe_screen *screen = tr_scr->screen;
struct pipe_surface *surface = tr_surf->surface;
trace_screen_texture_destroy(struct pipe_texture *_texture)
{
struct trace_screen *tr_scr = trace_screen(_texture->screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _texture);
+ struct trace_texture *tr_tex = trace_texture(_texture);
struct pipe_screen *screen = tr_scr->screen;
struct pipe_texture *texture = tr_tex->texture;
trace_dump_call_end();
- trace_texture_destroy(tr_scr, _texture);
+ trace_texture_destroy(tr_tex);
}
unsigned usage)
{
struct trace_screen *tr_scr = trace_screen(_screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _texture);
+ struct trace_texture *tr_tex = trace_texture(_texture);
struct pipe_screen *screen = tr_scr->screen;
struct pipe_texture *texture = tr_tex->texture;
struct pipe_surface *result = NULL;
trace_screen_tex_surface_destroy(struct pipe_surface *_surface)
{
struct trace_screen *tr_scr = trace_screen(_surface->texture->screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _surface->texture);
- struct trace_surface *tr_surf = trace_surface(tr_tex, _surface);
+ struct trace_surface *tr_surf = trace_surface(_surface);
struct pipe_screen *screen = tr_scr->screen;
struct pipe_surface *surface = tr_surf->surface;
trace_dump_call_end();
- trace_surface_destroy(tr_tex, _surface);
+ trace_surface_destroy(tr_surf);
}
unsigned x, unsigned y, unsigned w, unsigned h)
{
struct trace_screen *tr_scr = trace_screen(_screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _texture);
+ struct trace_texture *tr_tex = trace_texture(_texture);
struct pipe_screen *screen = tr_scr->screen;
struct pipe_texture *texture = tr_tex->texture;
struct pipe_transfer *result = NULL;
trace_screen_tex_transfer_destroy(struct pipe_transfer *_transfer)
{
struct trace_screen *tr_scr = trace_screen(_transfer->texture->screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _transfer->texture);
- struct trace_transfer *tr_tran = trace_transfer(tr_tex, _transfer);
+ struct trace_transfer *tr_trans = trace_transfer(_transfer);
struct pipe_screen *screen = tr_scr->screen;
- struct pipe_transfer *transfer = tr_tran->transfer;
+ struct pipe_transfer *transfer = tr_trans->transfer;
trace_dump_call_begin("pipe_screen", "tex_transfer_destroy");
trace_dump_call_end();
- trace_transfer_destroy(tr_tex, _transfer);
+ trace_transfer_destroy(tr_trans);
}
struct pipe_transfer *_transfer)
{
struct trace_screen *tr_scr = trace_screen(_screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _transfer->texture);
- struct trace_transfer *tr_trans = trace_transfer(tr_tex, _transfer);
+ struct trace_transfer *tr_trans = trace_transfer(_transfer);
struct pipe_screen *screen = tr_scr->screen;
struct pipe_transfer *transfer = tr_trans->transfer;
void *map;
struct pipe_transfer *_transfer)
{
struct trace_screen *tr_scr = trace_screen(_screen);
- struct trace_texture *tr_tex = trace_texture(tr_scr, _transfer->texture);
- struct trace_transfer *tr_trans = trace_transfer(tr_tex, _transfer);
+ struct trace_transfer *tr_trans = trace_transfer(_transfer);
struct pipe_screen *screen = tr_scr->screen;
struct pipe_transfer *transfer = tr_trans->transfer;
void
-trace_texture_destroy(struct trace_screen *tr_scr,
- struct pipe_texture *texture)
+trace_texture_destroy(struct trace_texture *tr_tex)
{
- struct trace_texture *tr_tex = trace_texture(tr_scr, texture);
pipe_texture_reference(&tr_tex->texture, NULL);
FREE(tr_tex);
}
void
-trace_surface_destroy(struct trace_texture *tr_tex,
- struct pipe_surface *surface)
+trace_surface_destroy(struct trace_surface *tr_surf)
{
- struct trace_surface *tr_surf = trace_surface(tr_tex, surface);
pipe_texture_reference(&tr_surf->base.texture, NULL);
pipe_surface_reference(&tr_surf->surface, NULL);
FREE(tr_surf);
void
-trace_transfer_destroy(struct trace_texture *tr_tex,
- struct pipe_transfer *transfer)
+trace_transfer_destroy(struct trace_transfer *tr_trans)
{
- struct trace_transfer *tr_trans = trace_transfer(tr_tex, transfer);
struct pipe_screen *screen = tr_trans->transfer->texture->screen;
pipe_texture_reference(&tr_trans->base.texture, NULL);
screen->tex_transfer_destroy(tr_trans->transfer);
static INLINE struct trace_texture *
-trace_texture(struct trace_screen *tr_scr,
- struct pipe_texture *texture)
+trace_texture(struct pipe_texture *texture)
{
if(!texture)
return NULL;
- assert(tr_scr);
- assert(texture->screen == &tr_scr->base);
+ (void)trace_screen(texture->screen);
return (struct trace_texture *)texture;
}
static INLINE struct trace_surface *
-trace_surface(struct trace_texture *tr_tex,
- struct pipe_surface *surface)
+trace_surface(struct pipe_surface *surface)
{
if(!surface)
return NULL;
- assert(tr_tex);
- assert(surface->texture == &tr_tex->base);
+ (void)trace_texture(surface->texture);
return (struct trace_surface *)surface;
}
static INLINE struct trace_transfer *
-trace_transfer(struct trace_texture *tr_tex,
- struct pipe_transfer *transfer)
+trace_transfer(struct pipe_transfer *transfer)
{
if(!transfer)
return NULL;
- assert(tr_tex);
- assert(transfer->texture == &tr_tex->base);
+ (void)trace_texture(transfer->texture);
return (struct trace_transfer *)transfer;
}
struct pipe_texture *texture);
void
-trace_texture_destroy(struct trace_screen *tr_scr,
- struct pipe_texture *texture);
+trace_texture_destroy(struct trace_texture *tr_tex);
struct pipe_surface *
trace_surface_create(struct trace_texture *tr_tex,
struct pipe_surface *surface);
void
-trace_surface_destroy(struct trace_texture *tr_tex,
- struct pipe_surface *surface);
+trace_surface_destroy(struct trace_surface *tr_surf);
struct pipe_transfer *
trace_transfer_create(struct trace_texture *tr_tex,
struct pipe_transfer *transfer);
void
-trace_transfer_destroy(struct trace_texture *tr_tex,
- struct pipe_transfer *transfer);
+trace_transfer_destroy(struct trace_transfer *tr_trans);
#endif /* TR_TEXTURE_H_ */