banshee r4388 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Collection.Gui



Author: gburt
Date: Sat Aug 16 22:30:59 2008
New Revision: 4388
URL: http://svn.gnome.org/viewvc/banshee?rev=4388&view=rev

Log:
2008-08-16  Gabriel Burt  <gabriel burt gmail com>

	* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs:
	Don't dispose the missing-coverart pixbuf, fixes recent issue with it
	disappearing.

	* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs:
	Fix issue with the Album Browser being really slow/mushy to scroll by only
	calling GC.Collect every 100th pixbuf.Dispose (BGO #547628).


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ArtworkRenderer.cs	Sat Aug 16 22:30:59 2008
@@ -104,12 +104,20 @@
             }
         }
         
+        private static int dispose_count = 0;
         public static void DisposePixbuf (Gdk.Pixbuf pixbuf)
         {
             if (pixbuf != null && pixbuf.Handle != IntPtr.Zero) {
                 pixbuf.Dispose ();
                 pixbuf = null;
-                GC.Collect ();
+                
+                // There is an issue with disposing Pixbufs where we need to explicitly 
+                // call the GC otherwise it doesn't get done in a timely way.  But if we
+                // do it every time, it slows things down a lot; so only do it every 100th.
+                if (++dispose_count % 100 == 0) {
+                    GC.Collect ();
+                    dispose_count = 0;
+                }
             }
         }
     }

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellAlbum.cs	Sat Aug 16 22:30:59 2008
@@ -78,7 +78,7 @@
             int x = pixbuf_spacing;
             int y = ((int)cellHeight - pixbuf_render_size) / 2;
             
-            ArtworkRenderer.RenderThumbnail (context.Context, pixbuf, true, x, y, 
+            ArtworkRenderer.RenderThumbnail (context.Context, pixbuf, !is_default, x, y, 
                 pixbuf_render_size, pixbuf_render_size, !is_default, context.Theme.Context.Radius);
                 
             int fl_width = 0, fl_height = 0, sl_width = 0, sl_height = 0;



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