Commit c4ced2a2 authored by Ray Strode's avatar Ray Strode
Browse files

Merge branch 'use-fallback-image-if-bgrt-is-not-supported' into 'master'

Use fallback image if BGRT is not supported

See merge request plymouth/plymouth!125
parents 53c83cc8 3ed2a1a9
Pipeline #270329 passed with stage
in 4 minutes and 20 seconds
...@@ -139,6 +139,7 @@ struct _ply_boot_splash_plugin ...@@ -139,6 +139,7 @@ struct _ply_boot_splash_plugin
ply_image_t *header_image; ply_image_t *header_image;
ply_image_t *background_tile_image; ply_image_t *background_tile_image;
ply_image_t *background_bgrt_image; ply_image_t *background_bgrt_image;
ply_image_t *background_bgrt_fallback_image;
ply_image_t *watermark_image; ply_image_t *watermark_image;
ply_list_t *views; ply_list_t *views;
...@@ -1048,6 +1049,10 @@ create_plugin (ply_key_file_t *key_file) ...@@ -1048,6 +1049,10 @@ create_plugin (ply_key_file_t *key_file)
plugin->background_tile_image = ply_image_new (image_path); plugin->background_tile_image = ply_image_new (image_path);
free (image_path); free (image_path);
asprintf (&image_path, "%s/bgrt-fallback.png", image_dir);
plugin->background_bgrt_fallback_image = ply_image_new (image_path);
free (image_path);
asprintf (&image_path, "%s/watermark.png", image_dir); asprintf (&image_path, "%s/watermark.png", image_dir);
plugin->watermark_image = ply_image_new (image_path); plugin->watermark_image = ply_image_new (image_path);
free (image_path); free (image_path);
...@@ -1243,6 +1248,9 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin) ...@@ -1243,6 +1248,9 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin)
if (plugin->background_bgrt_image != NULL) if (plugin->background_bgrt_image != NULL)
ply_image_free (plugin->background_bgrt_image); ply_image_free (plugin->background_bgrt_image);
if (plugin->background_bgrt_fallback_image != NULL)
ply_image_free (plugin->background_bgrt_fallback_image);
if (plugin->watermark_image != NULL) if (plugin->watermark_image != NULL)
ply_image_free (plugin->watermark_image); ply_image_free (plugin->watermark_image);
...@@ -1655,11 +1663,17 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin, ...@@ -1655,11 +1663,17 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin,
plugin->background_bgrt_raw_width = ply_image_get_width (plugin->background_bgrt_image); plugin->background_bgrt_raw_width = ply_image_get_width (plugin->background_bgrt_image);
plugin->background_bgrt_raw_height = ply_image_get_height (plugin->background_bgrt_image); plugin->background_bgrt_raw_height = ply_image_get_height (plugin->background_bgrt_image);
} else { } else {
ply_image_free (plugin->background_bgrt_image); ply_trace ("loading background bgrt fallback image");
plugin->background_bgrt_image = NULL; if (ply_image_load (plugin->background_bgrt_fallback_image)) {
for (i = 0; i < PLY_BOOT_SPLASH_MODE_COUNT; i++) plugin->background_bgrt_image = plugin->background_bgrt_fallback_image;
plugin->mode_settings[i].use_firmware_background = false; plugin->background_bgrt_fallback_image = NULL;
plugin->use_firmware_background = false; } else {
ply_image_free (plugin->background_bgrt_image);
plugin->background_bgrt_image = NULL;
for (i = 0; i < PLY_BOOT_SPLASH_MODE_COUNT; i++)
plugin->mode_settings[i].use_firmware_background = false;
plugin->use_firmware_background = false;
}
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment