[gnome-desktop/wip/muktupavels/hidpi] bg: do not duplicate drawing code
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop/wip/muktupavels/hidpi] bg: do not duplicate drawing code
- Date: Sun, 24 Nov 2019 19:34:47 +0000 (UTC)
commit 2f1fb60cf684710c61617e4dd3e81a57def00883
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Nov 24 21:33:48 2019 +0200
bg: do not duplicate drawing code
libgnome-desktop/gnome-bg.c | 42 ++++++++++++++++--------------------------
1 file changed, 16 insertions(+), 26 deletions(-)
---
diff --git a/libgnome-desktop/gnome-bg.c b/libgnome-desktop/gnome-bg.c
index d35d666e..0a790423 100644
--- a/libgnome-desktop/gnome-bg.c
+++ b/libgnome-desktop/gnome-bg.c
@@ -967,34 +967,12 @@ draw_each_monitor (GnomeBG *bg,
}
}
-void
-gnome_bg_draw (GnomeBG *bg,
- GdkPixbuf *dest,
- GdkScreen *screen,
- gboolean is_root)
-{
- if (!bg)
- return;
-
- if (is_root && (bg->placement != G_DESKTOP_BACKGROUND_STYLE_SPANNED)) {
- draw_color_each_monitor (bg, dest, screen, 1);
- if (bg->placement != G_DESKTOP_BACKGROUND_STYLE_NONE) {
- draw_each_monitor (bg, dest, screen, 1);
- }
- } else {
- draw_color (bg, dest);
- if (bg->placement != G_DESKTOP_BACKGROUND_STYLE_NONE) {
- draw_once (bg, dest);
- }
- }
-}
-
static void
gnome_bg_draw_at_scale (GnomeBG *bg,
- GdkPixbuf *dest,
- gint scale,
- GdkScreen *screen,
- gboolean is_root)
+ GdkPixbuf *dest,
+ gint scale,
+ GdkScreen *screen,
+ gboolean is_root)
{
if (is_root && (bg->placement != G_DESKTOP_BACKGROUND_STYLE_SPANNED)) {
draw_color_each_monitor (bg, dest, screen, scale);
@@ -1009,6 +987,18 @@ gnome_bg_draw_at_scale (GnomeBG *bg,
}
}
+void
+gnome_bg_draw (GnomeBG *bg,
+ GdkPixbuf *dest,
+ GdkScreen *screen,
+ gboolean is_root)
+{
+ if (!bg)
+ return;
+
+ gnome_bg_draw_at_scale (bg, dest, 1, screen, is_root);
+}
+
gboolean
gnome_bg_has_multiple_sizes (GnomeBG *bg)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]