[gnome-music] Revert "Add rounded corners to album art in the Albums view"



commit 55500c9d74d7ff0011939ce120a97dd1b8167b70
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue May 21 13:01:43 2013 +0200

    Revert "Add rounded corners to album art in the Albums view"
    
    This reverts commit 73123e6beecb1587f18d3275283260cc793622c5.
    
    Should be applied after https://bugzilla.gnome.org/show_bug.cgi?id=700529 is in gjs master

 src/albumArtCache.js |   63 ++++++++++++++++++++-----------------------------
 1 files changed, 26 insertions(+), 37 deletions(-)
---
diff --git a/src/albumArtCache.js b/src/albumArtCache.js
index 9dff5a3..1cd541b 100644
--- a/src/albumArtCache.js
+++ b/src/albumArtCache.js
@@ -19,11 +19,9 @@
  */
 
 const Lang = imports.lang;
-const Cairo = imports.cairo;
 const GdkPixbuf = imports.gi.GdkPixbuf;
 const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
-const Gdk = imports.gi.Gdk;
 const Gio = imports.gi.Gio;
 const Regex = GLib.Regex;
 const Path = GLib.Path;
@@ -195,44 +193,35 @@ const AlbumArtCache = new Lang.Class({
     },
 
     makeIconFrame: function (pixbuf) {
-        border = 1.5;
-        pixbuf = pixbuf.scale_simple(pixbuf.get_width() - border * 2,
-                                     pixbuf.get_height() - border * 2,
-                                     0);
-
-        let surface =  new Cairo.ImageSurface (Cairo.Format.ARGB32,
-                                               pixbuf.get_width() + border * 2,
-                                               pixbuf.get_height() + border * 2);
-        let ctx = new Cairo.Context(surface);
-        this.drawRoundedPath(ctx, 0, 0,
-                             pixbuf.get_width()  + border * 2,
-                             pixbuf.get_height()  + border * 2,
-                             3);
-        let result = Gdk.pixbuf_get_from_surface(surface, 0, 0,
-            pixbuf.get_width() + border * 2, pixbuf.get_height() + border * 2);
-
+        var border = 3;
+        var color = 0xffffffff;
+        var result = GdkPixbuf.Pixbuf.new(pixbuf.get_colorspace(),
+                                true,
+                                pixbuf.get_bits_per_sample(),
+                                pixbuf.get_width(),
+                                pixbuf.get_height());
+        result.fill(color);
         pixbuf.copy_area(border, border,
-                        pixbuf.get_width() - border * 2,
-                        pixbuf.get_height() - border * 2,
+                        pixbuf.get_width() - (border * 2), pixbuf.get_height() - (border * 2),
                         result,
-                        border * 2, border * 2);
-
-        return result;
-    },
+                        border, border);
+
+        pixbuf = result;
+
+        border = 1;
+        color = 0x00000044;
+        var result2 = GdkPixbuf.Pixbuf.new(pixbuf.get_colorspace(),
+                                true,
+                                pixbuf.get_bits_per_sample(),
+                                pixbuf.get_width(),
+                                pixbuf.get_height());
+        result2.fill(color);
+        pixbuf.copy_area(border, border,
+                        pixbuf.get_width() - (border * 2), pixbuf.get_height() - (border * 2),
+                        result2,
+                        border, border);
 
-    drawRoundedPath: function (ctx, x, y, width, height, radius, preserve) {
-        let degrees = Math.PI / 180;
-        ctx.newSubPath();
-        ctx.arc(x + width - radius, y + radius, radius - 0.5, -90 * degrees, 0 * degrees);
-        ctx.arc(x + width - radius, y + height - radius, radius - 0.5, 0 * degrees, 90 * degrees);
-        ctx.arc(x + radius, y + height - radius, radius - 0.5, 90 * degrees, 180 * degrees);
-        ctx.arc(x + radius, y + radius, radius - 0.5, 180 * degrees, 270 * degrees);
-        ctx.closePath();
-        ctx.setLineWidth(0.6);
-        ctx.setSourceRGB(0.2, 0.2, 0.2);
-        ctx.strokePreserve();
-        ctx.setSourceRGB(1, 1, 1);
-        ctx.fill()
+        return result2;
     },
 
     _keybuilder_funcs: [


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