OSDN Git Service

use psyco when available
authorMartin Renold <martinxyz@gmx.ch>
Sun, 25 Jan 2009 14:44:23 +0000 (14:44 +0000)
committerMartin Renold <martinxyz@gmx.ch>
Sun, 25 Jan 2009 14:44:23 +0000 (14:44 +0000)
svn://svn.gna.org/svn/mypaint/trunk@265

README
gui/tileddrawwidget.py
mypaint.in

diff --git a/README b/README
index 9cf57dc..322a12b 100644 (file)
--- a/README
+++ b/README
@@ -16,6 +16,7 @@ Building on Linux:
 
     Required: pygtk, python, swig, gtk, numpy
     Debian and derivatives need: python-gtk2-dev python-numpy swig scons
+    Slow PCs will get a small speedup by installing psyco.
 
     Recommended: a pressure sensitive input device (graphic tablet)
 
index df590d0..7ac5d31 100644 (file)
@@ -145,13 +145,8 @@ class TiledDrawWidget(gtk.DrawingArea):
         #  if (event.y >= (screen_h-1)-trigger_area):
         #    self.scroll(0,10)
 
-        if not self.doc.brush:
-            print 'no brush!'
-            return
-
-        func = self.pressure_mapping
-        if func:
-            pressure = func(pressure)
+        if self.pressure_mapping:
+            pressure = self.pressure_mapping(pressure)
         self.doc.stroke_to(dtime, x, y, pressure)
 
     def canvas_modified_cb(self, x1, y1, w, h):
index 5de2af9..164038f 100644 (file)
@@ -11,6 +11,15 @@ This script does all the platform dependent stuff. Its main task is
 to figure out where the python modules are.
 """
 
+# This helps on slow PCs where the python overhead dominates.
+# (30% higher framerate measured on 533MHz CPU; startup slowdown below 20%)
+# Note: python -O -O does not help.
+try:
+    import psyco
+    psyco.full()
+except ImportError:
+    pass
+
 import sys, os
 join = os.path.join