drawing video borders in ruby is too slow, do it in extension
[booh] / bin / booh-classifier
index c7c6efe594f9d18bc3eae4253834cd20248b7615..5d02353764a6b3929d576a954327da1f796178df 100644 (file)
@@ -490,13 +490,7 @@ class MainView < Gtk::DrawingArea
         if @pixbuf
             window.draw_pixbuf(nil, @pixbuf, 0, 0, @xpos, @ypos, -1, -1, Gdk::RGB::DITHER_NONE, -1, -1)
             if @entry && @entry.type == 'video'
-                y = @ypos
-                while y < @ypos + @pixbuf.height
-                    render_height = [ @pixbuf.height, @ypos + @pixbuf.height - y ].min
-                    window.draw_pixbuf(nil, $videoborder_pixbuf, 0, 0, @xpos - $videoborder_pixbuf.width, y, -1, render_height, Gdk::RGB::DITHER_NONE, -1, -1)
-                    window.draw_pixbuf(nil, $videoborder_pixbuf, 0, 0, @xpos + @pixbuf.width, y, -1, render_height, Gdk::RGB::DITHER_NONE, -1, -1)
-                    y += $videoborder_pixbuf.height
-                end
+                window.draw_borders($videoborder_pixbuf, @xpos - $videoborder_pixbuf.width, @xpos + @pixbuf.width, @ypos, @ypos + @pixbuf.height)
             end
         end
     end