[gnome-flashback] common: add gf_bg_get_average_color_from_surface



commit 182f1eafb3a01a42c1ef6d4778642d7865b2c107
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Mar 20 17:32:51 2021 +0200

    common: add gf_bg_get_average_color_from_surface

 gnome-flashback/libcommon/gf-bg.c | 6 ++++++
 gnome-flashback/libcommon/gf-bg.h | 2 ++
 2 files changed, 8 insertions(+)
---
diff --git a/gnome-flashback/libcommon/gf-bg.c b/gnome-flashback/libcommon/gf-bg.c
index 841d5c9..5e80ff8 100644
--- a/gnome-flashback/libcommon/gf-bg.c
+++ b/gnome-flashback/libcommon/gf-bg.c
@@ -2085,3 +2085,9 @@ read_slideshow_file (const char *filename,
 
         return show;
 }
+
+GdkRGBA *
+gf_bg_get_average_color_from_surface (cairo_surface_t *surface)
+{
+  return cairo_surface_get_user_data (surface, &average_color_key);
+}
diff --git a/gnome-flashback/libcommon/gf-bg.h b/gnome-flashback/libcommon/gf-bg.h
index ea24f6f..e7499a7 100644
--- a/gnome-flashback/libcommon/gf-bg.h
+++ b/gnome-flashback/libcommon/gf-bg.h
@@ -67,6 +67,8 @@ GnomeBGCrossfade *gf_bg_set_surface_as_root_with_crossfade    (GdkScreen *screen
                                                               cairo_surface_t *surface);
 cairo_surface_t *gf_bg_get_surface_from_root (GdkScreen *screen);
 
+GdkRGBA *gf_bg_get_average_color_from_surface (cairo_surface_t *surface);
+
 G_END_DECLS
 
 #endif


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