[pitivi] previewer.py: set cairo surface directly in _thumbForTime



commit 40aeb121110733b565aa8e9b6a47e4f90a45cf07
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date:   Wed Jul 29 15:51:18 2009 -0700

    previewer.py: set cairo surface directly in _thumbForTime

 pitivi/ui/previewer.py |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/ui/previewer.py b/pitivi/ui/previewer.py
index 02dd6ec..c8f0072 100644
--- a/pitivi/ui/previewer.py
+++ b/pitivi/ui/previewer.py
@@ -254,7 +254,7 @@ class RandomAccessPreviewer(Previewer):
         j = Zoomable.pixelToNs(i - sof)
 
         while i < bounds.x2:
-            cr.set_source_surface(self._thumbForTime(j), i, y1)
+            self._thumbForTime(cr, j, i, y1)
             cr.rectangle(i - 1, y1, self.twidth + 2, self.theight)
             i += self.twidth + self._spacing()
             j += tdur
@@ -272,13 +272,14 @@ class RandomAccessPreviewer(Previewer):
 
         raise NotImplementedError
 
-    def _thumbForTime(self, time):
+    def _thumbForTime(self, cr, time, x, y):
         segment = self._segment_for_time(time)
         if segment in self._cache:
-            return self._cache[segment]
-
-        self._requestThumbnail(segment)
-        return self.default_thumb
+            surface = self._cache[segment]
+        else:
+            self._requestThumbnail(segment)
+            surface = self.default_thumb
+        cr.set_source_surface(surface, x, y)
 
     def _finishThumbnail(self, surface, segment):
         """Notifies the preview object that the a new thumbnail is ready to be



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