tr_texture.c File Reference

Include dependency graph for tr_texture.c:

Go to the source code of this file.

Functions

struct pipe_texturetrace_texture_create (struct trace_screen *tr_scr, struct pipe_texture *texture)
void trace_texture_destroy (struct trace_screen *tr_scr, struct pipe_texture *texture)
struct pipe_surfacetrace_surface_create (struct trace_texture *tr_tex, struct pipe_surface *surface)
void trace_surface_destroy (struct trace_texture *tr_tex, struct pipe_surface *surface)


Function Documentation

struct pipe_surface* trace_surface_create ( struct trace_texture tr_tex,
struct pipe_surface surface 
) [read]

Definition at line 74 of file tr_texture.c.

References assert, trace_texture::base, trace_surface::base, CALLOC_STRUCT, pipe_surface_reference(), pipe_texture_reference(), pipe_texture::screen, trace_surface::surface, trace_texture::texture, pipe_surface::texture, pipe_screen::winsys, and pipe_surface::winsys.

00076 {
00077    struct trace_surface *tr_surf;
00078    
00079    if(!surface)
00080       goto error;
00081    
00082    assert(surface->texture == tr_tex->texture);
00083    
00084    tr_surf = CALLOC_STRUCT(trace_surface);
00085    if(!tr_surf)
00086       goto error;
00087    
00088    memcpy(&tr_surf->base, surface, sizeof(struct pipe_surface));
00089    
00090    tr_surf->base.winsys = tr_tex->base.screen->winsys;
00091    tr_surf->base.texture = NULL;
00092    pipe_texture_reference(&tr_surf->base.texture, &tr_tex->base);
00093    tr_surf->surface = surface;
00094 
00095    return &tr_surf->base;
00096    
00097 error:
00098    pipe_surface_reference(&surface, NULL);
00099    return NULL;
00100 }

void trace_surface_destroy ( struct trace_texture tr_tex,
struct pipe_surface surface 
)

Definition at line 104 of file tr_texture.c.

References trace_surface::base, FREE, pipe_surface_reference(), pipe_texture_reference(), trace_surface::surface, pipe_surface::texture, and trace_surface().

00106 {
00107    struct trace_surface *tr_surf = trace_surface(tr_tex, surface);
00108    pipe_texture_reference(&tr_surf->base.texture, NULL);
00109    pipe_surface_reference(&tr_surf->surface, NULL);
00110    FREE(tr_surf);
00111 }

struct pipe_texture* trace_texture_create ( struct trace_screen tr_scr,
struct pipe_texture texture 
) [read]

Definition at line 37 of file tr_texture.c.

References assert, trace_screen::base, trace_texture::base, CALLOC_STRUCT, pipe_texture_reference(), trace_screen::screen, pipe_texture::screen, and trace_texture::texture.

00039 {
00040    struct trace_texture *tr_tex;
00041    
00042    if(!texture)
00043       goto error;
00044    
00045    assert(texture->screen == tr_scr->screen);
00046    
00047    tr_tex = CALLOC_STRUCT(trace_texture);
00048    if(!tr_tex)
00049       goto error;
00050    
00051    memcpy(&tr_tex->base, texture, sizeof(struct pipe_texture));
00052    tr_tex->base.screen = &tr_scr->base;
00053    tr_tex->texture = texture;
00054    
00055    return &tr_tex->base;
00056    
00057 error:
00058    pipe_texture_reference(&texture, NULL);
00059    return NULL;
00060 }

void trace_texture_destroy ( struct trace_screen tr_scr,
struct pipe_texture texture 
)

Definition at line 64 of file tr_texture.c.

References FREE, pipe_texture_reference(), trace_texture::texture, and trace_texture().

00066 {
00067    struct trace_texture *tr_tex = trace_texture(tr_scr, texture); 
00068    pipe_texture_reference(&tr_tex->texture, NULL);
00069    FREE(tr_tex);
00070 }


Generated on Tue Sep 29 06:25:43 2009 for Gallium3D by  doxygen 1.5.4