From ce869227f2590f7c4d299366462fff6325d3b1ad Mon Sep 17 00:00:00 2001 From: nerdopolis Date: Tue, 21 Nov 2023 19:45:03 -0500 Subject: [PATCH] two-step: Support a ScaleBackgroundWallpaper to scale the background instead of tiling it --- src/plugins/splash/two-step/plugin.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 0dd273a1..75919ed8 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -189,6 +189,7 @@ struct _ply_boot_splash_plugin uint32_t is_animating : 1; uint32_t is_idle : 1; uint32_t use_firmware_background : 1; + uint32_t background_image_is_scaled : 1; uint32_t dialog_clears_firmware_background : 1; uint32_t message_below_animation : 1; }; @@ -630,7 +631,12 @@ view_load (view_t *view) ply_pixel_buffer_fill_with_hex_color (view->background_buffer, NULL, plugin->background_start_color); - buffer = ply_pixel_buffer_tile (ply_image_get_buffer (plugin->background_tile_image), screen_width, screen_height); + if (plugin->background_image_is_scaled) { + buffer = ply_pixel_buffer_resize (ply_image_get_buffer (plugin->background_tile_image), screen_width, screen_height); + } else { + buffer = ply_pixel_buffer_tile (ply_image_get_buffer (plugin->background_tile_image), screen_width, screen_height); + } + ply_pixel_buffer_fill_with_buffer (view->background_buffer, buffer, 0, 0); ply_pixel_buffer_free (buffer); } @@ -1099,6 +1105,9 @@ create_plugin (ply_key_file_t *key_file) plugin->watermark_image = ply_image_new (image_path); free (image_path); + plugin->background_image_is_scaled = + ply_key_file_get_bool (key_file, "two-step", "ScaleBackgroundWallpaper"); + if (!ply_kernel_command_line_has_argument ("secure_boot.warn_if_disabled=false") && !ply_is_secure_boot_enabled ()) { asprintf (&image_path, "%s/emblem-warning.png", image_dir);