[gnome-flashback] common: remove gf_bg_is_dark



commit 7eda01ca05b9ff611763b12b0f8f989ad8f2b9b4
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Mar 20 18:13:51 2021 +0200

    common: remove gf_bg_is_dark

 gnome-flashback/libcommon/gf-bg.c | 37 -------------------------------------
 gnome-flashback/libcommon/gf-bg.h |  3 ---
 2 files changed, 40 deletions(-)
---
diff --git a/gnome-flashback/libcommon/gf-bg.c b/gnome-flashback/libcommon/gf-bg.c
index 99f3506..360cd5c 100644
--- a/gnome-flashback/libcommon/gf-bg.c
+++ b/gnome-flashback/libcommon/gf-bg.c
@@ -1014,43 +1014,6 @@ gf_bg_create_surface (GfBG      *bg,
        return surface;
 }
 
-gboolean
-gf_bg_is_dark (GfBG *bg,
-               int   width,
-               int   height)
-{
-       GdkRGBA color;
-       gdouble intensity;
-       GdkPixbuf *pixbuf;
-       
-       g_return_val_if_fail (bg != NULL, FALSE);
-       
-       if (bg->color_type == G_DESKTOP_BACKGROUND_SHADING_SOLID) {
-               color = bg->primary;
-       } else {
-               color.red = (bg->primary.red + bg->secondary.red) / 2;
-               color.green = (bg->primary.green + bg->secondary.green) / 2;
-               color.blue = (bg->primary.blue + bg->secondary.blue) / 2;
-       }
-       pixbuf = get_pixbuf_for_size (bg, -1, width, height);
-       if (pixbuf) {
-               GdkRGBA average;
-
-               pixbuf_average_value (pixbuf, &average);
-               
-               color.red = color.red * (1.0 - average.alpha) + average.red * average.alpha;
-               color.green = color.green * (1.0 - average.alpha) + average.green * average.alpha;
-               color.blue = color.blue * (1.0 - average.alpha) + average.blue * average.alpha;
-               g_object_unref (pixbuf);
-       }
-       
-       intensity = color.red * 77 +
-                   color.green * 150 +
-                   color.blue * 28;
-       
-       return intensity < 160; /* biased slightly to be dark */
-}
-
 /* 
  * Create a persistent pixmap. We create a separate display
  * and set the closedown mode on it to RetainPermanent.
diff --git a/gnome-flashback/libcommon/gf-bg.h b/gnome-flashback/libcommon/gf-bg.h
index a1e14de..ffc8794 100644
--- a/gnome-flashback/libcommon/gf-bg.h
+++ b/gnome-flashback/libcommon/gf-bg.h
@@ -52,9 +52,6 @@ cairo_surface_t *gf_bg_create_surface           (GfBG                  *bg,
                                                 int                    width,
                                                 int                    height,
                                                 gboolean               root);
-gboolean         gf_bg_is_dark                  (GfBG                  *bg,
-                                                 int                    dest_width,
-                                                int                    dest_height);
 
 void             gf_bg_set_surface_as_root      (GdkScreen             *screen,
                                                 cairo_surface_t       *surface);


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