gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx/demo coords_benchmark.py


From: Matti Katila
Subject: [Gzz-commits] gzz/gfx/demo coords_benchmark.py
Date: Thu, 13 Mar 2003 10:31:08 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   03/03/13 10:31:07

Modified files:
        gfx/demo       : coords_benchmark.py 

Log message:
        I get 24 passes.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/coords_benchmark.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/coords_benchmark.py
diff -u gzz/gfx/demo/coords_benchmark.py:1.2 
gzz/gfx/demo/coords_benchmark.py:1.3
--- gzz/gfx/demo/coords_benchmark.py:1.2        Thu Mar 13 09:50:35 2003
+++ gzz/gfx/demo/coords_benchmark.py    Thu Mar 13 10:31:04 2003
@@ -26,20 +26,19 @@
 from test.tools import tools
 from gzz.vob.vobs import *
 
-style = GraphicsAPI.getInstance().getTextStyle("serif", 0, 14)
 
 dbg = 1
 
 class ViewScene:
     def __init__(self):
         self.passes = 0
-        self.time = System.currentTimeMillis()
+        self.time = 0
         self.diff = 0
     
     def scene(self, vs):
         size = vs.getSize()
-        w = size.width*2/5
-        h = size.height*2/5
+        w = size.width*2/4
+        h = size.height*2/4
         r = java.util.Random()
 
         # moves
@@ -49,6 +48,12 @@
        bgcolor = (0.6, 0.7, 0.8)
         putnoc(vs, background(bgcolor))
 
+
+        # clipping area
+        clip = vs.orthoCS(0,"CLIP",0, #0,0, size.width, size.height)
+                          size.width*1/20, size.height*1/20,
+                          size.width*9/10, size.height*9/10)
+
         tr = vs.translateCS(0, 'tr', movx,movy) 
 
         for i in range(0,self.passes):
@@ -61,20 +66,31 @@
             else:
                 tr = vs.translateCS(tr, 'trd'+str(i), movx,0)
 
-        for i in range(0,1000):
+        for i in range(0,800):
             cs = vs.translateCS(tr, 'TEXT'+str(i),
                                 r.nextFloat()*w, r.nextFloat()*h)
+            cs = vs.cullCS(cs, 'CULL'+str(i), clip)
             putText(vs, cs, str(i), color=(0,0,0), h=14, y=10)
         self.passes += 1
 
+        # count time
         time = System.currentTimeMillis()
+        real = time - self.time
+        if real > 15*1000:
+            real = 0
+            
         if dbg:
             print 'Passes: ', self.passes, \
                   ' time: ', time - self.time, \
                   ' diff: ', time - self.time - self.diff
         self.diff = time - self.time
         self.time = time
-        AbstractUpdateManager.chg()            
+
+        if real < 1500:
+            AbstractUpdateManager.chg()
+        else:
+            print 'Stop! - passes:', self.passes ,' time:', real
+            print 'press r to rerun'
  
 
 currentScene = ViewScene()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]