From 136ff67ce8a626e628dd76aeb7feba8cf9436cd7 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 5 Nov 2010 18:54:02 +0100 Subject: graw: Export graw_save_surface_to_file(). Allows applications to dump surfaces to file without referencing gallium/auxiliary entry points statically. Existing test apps have been modified such that they save the contents of the fronbuffer only when the `-o' option's specified. --- src/gallium/include/state_tracker/graw.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/gallium/include') diff --git a/src/gallium/include/state_tracker/graw.h b/src/gallium/include/state_tracker/graw.h index 6a99b234aa..8da197f68b 100644 --- a/src/gallium/include/state_tracker/graw.h +++ b/src/gallium/include/state_tracker/graw.h @@ -71,4 +71,25 @@ PUBLIC void *graw_parse_vertex_shader( struct pipe_context *pipe, PUBLIC void *graw_parse_fragment_shader( struct pipe_context *pipe, const char *text ); +/* Parse a single command-line option, if any. Options include: + * + * -o + * + * If an option has been successfully parsed, argi is updated + * to point just after the option and return TRUE. + */ +PUBLIC boolean graw_parse_args(int *argi, int argc, char *argv[]); + +/* Saves surface contents to a file. + * + * If filename is NULL, the filename provided with the `-o' option + * is used. If the option has not been specified, the surface + * will not be saved. + * + * Returns TRUE if the surface has been saved. + */ +PUBLIC boolean graw_save_surface_to_file(struct pipe_context *pipe, + struct pipe_surface *surface, + const char *filename); + #endif -- cgit v1.2.3