banshee r3710 - in trunk/banshee: . src/Core/Banshee.ThickClient src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs src/Core/Banshee.ThickClient/Banshee.Gui.Widgets src/Libraries/Hyena.Gui/Hyena.Data.Gui src/Libraries/Hyena.Gui/Hyena.Gui



Author: abock
Date: Tue Apr  8 01:27:38 2008
New Revision: 3710
URL: http://svn.gnome.org/viewvc/banshee?rev=3710&view=rev

Log:
2008-04-07  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/ExtensionManagerDialog.cs:
    Nothing here yet, hopefully I can actually spare some time for it

    * src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs:
    * src/Libraries/Hyena.Gui/Hyena.Gui/ShadingTestWindow.cs: Removed rogue
    LayoutPath calls, replaced with ShowLayout

    * src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs: Did some
    profiling and switched the text renderer to Cairo since it's actually
    faster than GTK - this is fucking awesome:

        Cairo (pango_cairo_show_layout): 0.303
        GTK   (gtk_paint_layout):        0.369
        Cairo (pango_cairo_layout_path): 0.980

    This means text is now drawn directly to the cairo context and not to
    the GdkDrawable, which means we'll be able to cache the rendering to
    an image surface which supports an alpha channel (unlike GdkPixmap), which
    will lead to more performance improvements, specifically when dragging

    * src/Libraries/Hyena.Gui/Hyena.Gui/PangoCairoHelper.cs: Added a contract
    argument to LayoutPath that conveys it has crappy performance



Added:
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/ExtensionManagerDialog.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
   trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/PangoCairoHelper.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/ShadingTestWindow.cs

Added: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/ExtensionManagerDialog.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/ExtensionManagerDialog.cs	Tue Apr  8 01:27:38 2008
@@ -0,0 +1,39 @@
+//
+// ExtensionManagerDialog.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace Banshee.Gui.Dialogs
+{
+    public class ExtensionManagerDialog
+    {
+        public ExtensionManagerDialog ()
+        {
+        }
+    }
+}

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	Tue Apr  8 01:27:38 2008
@@ -399,9 +399,8 @@
             
             if (renderTrack) {
                 cr.MoveTo (x, y);
-                PangoCairoHelper.LayoutPath (cr, first_line_layout);
                 cr.Color = text_color;
-                cr.Fill ();
+                PangoCairoHelper.ShowLayout (cr, first_line_layout);
             }
 
             if (!renderArtistAlbum) {

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	Tue Apr  8 01:27:38 2008
@@ -95,6 +95,7 @@
     <File name="Banshee.Sources.Gui/ITrackModelSourceContents.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Gui.Widgets/NextArrowButton.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Gui/PlaybackShuffleActions.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.Gui.Dialogs/ExtensionManagerDialog.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="False" refto="Hyena.Gui" />

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Makefile.am	Tue Apr  8 01:27:38 2008
@@ -25,6 +25,7 @@
 	Banshee.Gui.Dialogs/AboutDialog.cs \
 	Banshee.Gui.Dialogs/ConfirmShutdownDialog.cs \
 	Banshee.Gui.Dialogs/ErrorListDialog.cs \
+	Banshee.Gui.Dialogs/ExtensionManagerDialog.cs \
 	Banshee.Gui.Dialogs/FileChooserDialog.cs \
 	Banshee.Gui.Dialogs/GladeDialog.cs \
 	Banshee.Gui.Dialogs/GladeWindow.cs \

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs	Tue Apr  8 01:27:38 2008
@@ -37,14 +37,21 @@
 {
     public class ColumnCellText : ColumnCell
     {
+        private static bool use_cairo_pango;
+        
+        static ColumnCellText ()
+        {
+            use_cairo_pango = String.IsNullOrEmpty (Environment.GetEnvironmentVariable ("USE_GTK_PANGO"));
+            Log.DebugFormat ("Text renderer: {0}", use_cairo_pango ? "Cairo" : "GTK");
+        }
+        
         public delegate string DataHandler ();
     
         private Pango.Weight font_weight = Pango.Weight.Normal;
         private Pango.EllipsizeMode ellipsize_mode = Pango.EllipsizeMode.End;
         private int text_width;
         private int text_height;
-        private bool use_cairo_pango = !String.IsNullOrEmpty (Environment.GetEnvironmentVariable ("USE_CAIRO_PANGO"));
-
+        
         public ColumnCellText (string property, bool expand) : base (property, expand)
         {
         }
@@ -61,10 +68,9 @@
             
             if (use_cairo_pango) {
                 context.Context.MoveTo (4, ((int)cellHeight - text_height) / 2);
-                PangoCairoHelper.LayoutPath (context.Context, context.Layout);
                 context.Context.Color = context.Theme.Colors.GetWidgetColor (
                     context.TextAsForeground ? GtkColorClass.Foreground : GtkColorClass.Text, state);
-                context.Context.Fill ();
+                PangoCairoHelper.ShowLayout (context.Context, context.Layout);
             } else {
                 Style.PaintLayout (context.Widget.Style, context.Drawable, state, !context.TextAsForeground, 
                     context.Clip, context.Widget, "text", context.Area.X + 4, 

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/PangoCairoHelper.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/PangoCairoHelper.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/PangoCairoHelper.cs	Tue Apr  8 01:27:38 2008
@@ -54,7 +54,8 @@
         [DllImport ("libpangocairo-1.0.so.0")]
         private static extern void pango_cairo_layout_path (IntPtr cr, IntPtr layout);
 
-        public static void LayoutPath (Cairo.Context cr, Pango.Layout layout) 
+        public static void LayoutPath (Cairo.Context cr, Pango.Layout layout, 
+            bool iUnderstandThePerformanceImplications) 
         {
             pango_cairo_layout_path (cr == null ? IntPtr.Zero : cr.Handle, 
                 layout == null ? IntPtr.Zero : layout.Handle);

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/ShadingTestWindow.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/ShadingTestWindow.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/ShadingTestWindow.cs	Tue Apr  8 01:27:38 2008
@@ -68,9 +68,8 @@
                     
                     cr.Translate (0.5, 0.5);
                     cr.MoveTo (x + (step_width - tw) / 2.0, y + (step_height - th) / 2.0);
-                    PangoCairoHelper.LayoutPath (cr, layout);
                     cr.Color = CairoExtensions.ColorFromHsb (h, s, fg_b);
-                    cr.Fill ();
+                    PangoCairoHelper.ShowLayout (cr, layout);
                     cr.Translate (-0.5, -0.5);
                 }
             }



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