From a6ad0c86cab0f3044781ece33d3ac0388e238a36 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 24 Mar 2009 21:35:10 +0000 Subject: python: Allow to dump all images to disk. --- src/gallium/state_trackers/python/retrace/interpreter.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/gallium/state_trackers/python/retrace') diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py index 6b9587bf2bf..66d73ed903f 100755 --- a/src/gallium/state_trackers/python/retrace/interpreter.py +++ b/src/gallium/state_trackers/python/retrace/interpreter.py @@ -75,7 +75,13 @@ def show_image(surface): root.mainloop() +# Verbosity level: 0, 1, 2 verbose = 1 +# Dump images to disk instead of showing: True, False +images = False + + +image_no = 0 class Struct: @@ -538,7 +544,13 @@ class Context(Object): self.real.flush() if self.cbufs and self.cbufs[0]: - show_image(self.cbufs[0]) + if images: + global image_no + image_no += 1 + filename = 'cbuf_%04u.png' % image_no + save_image(filename, self.cbufs[0]) + else: + show_image(self.cbufs[0]) class Interpreter(parser.TraceDumper): -- cgit v1.2.3