diff options
author | José Fonseca <[email protected]> | 2009-03-24 21:35:10 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-03-25 21:03:22 +0000 |
commit | a6ad0c86cab0f3044781ece33d3ac0388e238a36 (patch) | |
tree | 887a864a09f01f0a98895ece01811c969f5d263e /src/gallium/state_trackers/python/retrace | |
parent | 8ca95d812148209f78c1e2501c3183623dcae0b2 (diff) |
python: Allow to dump all images to disk.
Diffstat (limited to 'src/gallium/state_trackers/python/retrace')
-rwxr-xr-x | src/gallium/state_trackers/python/retrace/interpreter.py | 14 |
1 files changed, 13 insertions, 1 deletions
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): |