python: Pretty-printing of blend state.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 14 Feb 2010 23:24:08 +0000 (23:24 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Sun, 14 Feb 2010 23:25:34 +0000 (23:25 +0000)
src/gallium/state_trackers/python/gallium.i
src/gallium/state_trackers/python/p_state.i

index d45c8bb0a5494d20d25b5e443a58aafaa5bb385c..ffb084e358b10b2e7806e2fc01e27f55d23dce40 100644 (file)
 #include "pipe/p_screen.h"
 #include "pipe/p_context.h"
 #include "pipe/p_shader_tokens.h"
-#include "cso_cache/cso_context.h"
+#include "os/os_stream.h"
 #include "util/u_inlines.h"
 #include "util/u_draw_quad.h"
 #include "util/u_tile.h"
 #include "util/u_math.h"
 #include "util/u_format.h"
+#include "util/u_dump.h"
 #include "util/u_memory.h"
+#include "cso_cache/cso_context.h"
 #include "tgsi/tgsi_text.h"
 #include "tgsi/tgsi_dump.h"
 
index 318fe1c46373e3fc7917c82919110414b8a9d2ff..b80e46bd0dfd79bf6b3c76fad76aef3c719783b6 100644 (file)
 };
 
 
+%extend pipe_blend_state
+{
+   %cstring_output_allocate_size(char **STRING, int *LENGTH, os_free(*$1));
+   void __str__(char **STRING, int *LENGTH)
+   {
+      struct os_stream *stream;
+
+      stream = os_str_stream_create(1);
+      util_dump_blend_state(stream, $self);
+
+      *STRING = os_str_stream_get_and_close(stream);
+      *LENGTH = strlen(*STRING);
+   }
+};
+
+
 %extend pipe_framebuffer_state {
    
    pipe_framebuffer_state(void) {