gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob/vob/paper papermill.py


From: Tuomas J. Lukka
Subject: [Gzz-commits] libvob/vob/paper papermill.py
Date: Tue, 05 Aug 2003 05:35:38 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/08/05 05:35:38

Modified files:
        vob/paper      : papermill.py 

Log message:
        Finally: pixbuf rendering of bgs

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/paper/papermill.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text

Patches:
Index: libvob/vob/paper/papermill.py
diff -u libvob/vob/paper/papermill.py:1.7 libvob/vob/paper/papermill.py:1.8
--- libvob/vob/paper/papermill.py:1.7   Wed Jun 25 07:23:32 2003
+++ libvob/vob/paper/papermill.py       Tue Aug  5 05:35:38 2003
@@ -75,6 +75,14 @@
 else:
     if dbg: print "Anisotropic filtering not available"
 
+
+# The size of the texture for an optimized paper
+optimizedPaperSize=256
+if not GL.workaroundStupidBuggyAtiDrivers:
+    # With ATI drivers, we won't even try to optimize papers.
+    # With others, create a stable offscreen surface on which
+    # to render the papers
+    optimizingWindow = 
vob.GraphicsAPI.getInstance().createStableOffscreen(optimizedPaperSize, 
optimizedPaperSize)
     
 dbg = 0
 
@@ -177,18 +185,18 @@
        # Now, we render a region.
        v = pap.repeat._getSTVectors()
 
-       s = 256
-       vs = w.createVobScene()
+       vs = optimizingWindow.createVobScene()
        vs.map.put(vob.vobs.SolidBackdropVob(java.awt.Color.red))
 
-       cs1 = vs.coords.ortho(0, 0, 0, 0, s+1, s+1)
+       cs1 = vs.coords.ortho(0, 0, 0, 0, 
+               optimizedPaperSize+1, optimizedPaperSize+1)
        cs2 = vs.coords.affine(
            0, 0, 0, 0, 
             v[0][0], v[0][1], v[1][0], v[1][1]
        )
        vs.map.put(GLRen.createPaperQuad(pap, 0, 0, 1, 1, 1),
            cs1, cs2)
-       w.renderStill(vs, 1)
+       optimizingWindow.renderStill(vs, 1)
 
        tex = GL.createTexture()
        texid = tex.getTexId()
@@ -201,13 +209,11 @@
            BindTexture TEXTURE_2D 0
        """ % locals())
 
-       if dbg:
-           print "READ: ", 0, vs.getSize().height-1-s, s, s
 
-       tex.copyTexImage2D(w.getRenderingSurface(), 
+       tex.copyTexImage2D(optimizingWindow.getRenderingSurface(), 
                        "FRONT", "TEXTURE_2D", 0,
-                       "RGB", 0, vs.getSize().height-1-s, 
-                           s, s, 0)
+                       "RGB", 0, 0, 
+                           optimizedPaperSize, optimizedPaperSize, 0)
 
        if dbg:
            vob.putil.texture.printTex(tex.getTexId())




reply via email to

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