Mesa (gallium-0.1): python: Allow to dump all images to disk.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon May 18 15:08:03 UTC 2009


Module: Mesa
Branch: gallium-0.1
Commit: b1d9e166e793db3424b17d78707d9164c48134b1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1d9e166e793db3424b17d78707d9164c48134b1

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Mar 24 21:35:10 2009 +0000

python: Allow to dump all images to disk.

---

 .../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 e6999a2..f5c988d 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):




More information about the mesa-commit mailing list