From addff821e0a036f7158758e0bf0ac97688d7500e Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 5 Nov 2018 15:03:28 +0100 Subject: ply-image: Do not assume all files are PNGs So far the image loading code has been assuming that all files are PNGs, this commit makes the code check the file-header before assuming the file is a PNG. This is a preparation patch for adding support for also being able to load BMP files. Signed-off-by: Hans de Goede --- src/libply-splash-graphics/ply-image.c | 45 +++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/src/libply-splash-graphics/ply-image.c b/src/libply-splash-graphics/ply-image.c index 8b469788..fbf42d61 100644 --- a/src/libply-splash-graphics/ply-image.c +++ b/src/libply-splash-graphics/ply-image.c @@ -55,6 +55,8 @@ struct _ply_image ply_pixel_buffer_t *buffer; }; +const uint8_t png_header[8] = { 0x89, 'P', 'N', 'G', 0x0d, 0x0a, 0x1a, 0x0a }; + ply_image_t * ply_image_new (const char *filename) { @@ -112,8 +114,8 @@ transform_to_argb32 (png_struct *png, } } -bool -ply_image_load (ply_image_t *image) +static bool +ply_image_load_png (ply_image_t *image, FILE *fp) { png_struct *png; png_info *info; @@ -121,13 +123,9 @@ ply_image_load (ply_image_t *image) int bits_per_pixel, color_type, interlace_method; png_byte **rows; uint32_t *bytes; - FILE *fp; assert (image != NULL); - - fp = fopen (image->filename, "re"); - if (fp == NULL) - return false; + assert (fp != NULL); png = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); assert (png != NULL); @@ -137,10 +135,8 @@ ply_image_load (ply_image_t *image) png_init_io (png, fp); - if (setjmp (png_jmpbuf (png)) != 0) { - fclose (fp); + if (setjmp (png_jmpbuf (png)) != 0) return false; - } png_read_info (png, info); png_get_IHDR (png, info, @@ -188,12 +184,39 @@ ply_image_load (ply_image_t *image) free (rows); png_read_end (png, info); - fclose (fp); png_destroy_read_struct (&png, &info, NULL); return true; } +bool +ply_image_load (ply_image_t *image) +{ + uint8_t header[16]; + bool ret = false; + FILE *fp; + + assert (image != NULL); + + fp = fopen (image->filename, "re"); + if (fp == NULL) + return false; + + if (fread (header, 1, 16, fp) != 16) + goto out; + + /* Rewind */ + if (fseek (fp, 0, SEEK_SET) != 0) + goto out; + + if (memcmp (header, png_header, sizeof(png_header)) == 0) + ret = ply_image_load_png (image, fp); + +out: + fclose (fp); + return ret; +} + uint32_t * ply_image_get_data (ply_image_t *image) { -- cgit v1.2.3 From f5915187b44dd18dd9d1956d169bb17fbd4078d4 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 6 Nov 2018 09:15:22 +0100 Subject: ply-image: Add support for loading BMPs Add support for loading BMP files. This is needed to be able to read the the ACPI BGRT graphics (the firmware splash shown at boot by the firmware). Signed-off-by: Hans de Goede --- src/libply-splash-graphics/ply-image.c | 88 ++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/libply-splash-graphics/ply-image.c b/src/libply-splash-graphics/ply-image.c index fbf42d61..204fd2e1 100644 --- a/src/libply-splash-graphics/ply-image.c +++ b/src/libply-splash-graphics/ply-image.c @@ -55,6 +55,27 @@ struct _ply_image ply_pixel_buffer_t *buffer; }; +struct bmp_file_header { + uint16_t id; + uint32_t file_size; + uint32_t reserved; + uint32_t bitmap_offset; +} __attribute__((__packed__)); + +struct bmp_dib_header { + uint32_t dib_header_size; + int32_t width; + int32_t height; + uint16_t planes; + uint16_t bpp; + uint32_t compression; + uint32_t bitmap_size; + uint32_t horz_resolution; + uint32_t vert_resolution; + uint32_t colors_used; + uint32_t colors_important; +} __attribute__((__packed__)); + const uint8_t png_header[8] = { 0x89, 'P', 'N', 'G', 0x0d, 0x0a, 0x1a, 0x0a }; ply_image_t * @@ -189,6 +210,69 @@ ply_image_load_png (ply_image_t *image, FILE *fp) return true; } +static bool +ply_image_load_bmp (ply_image_t *image, FILE *fp) +{ + uint32_t x, y, src_y, width, height, bmp_pitch, *dst; + struct bmp_file_header file_header; + struct bmp_dib_header dib_header; + uint8_t r, g, b, *buf, *src; + bool ret = false; + + assert (image != NULL); + assert (fp != NULL); + + if (fread (&file_header, 1, sizeof(struct bmp_file_header), fp) != sizeof(struct bmp_file_header)) + return false; + + if (fread (&dib_header, 1, sizeof(struct bmp_dib_header), fp) != sizeof(struct bmp_dib_header)) + return false; + + if (dib_header.dib_header_size != 40 || dib_header.width < 0 || + dib_header.planes != 1 || dib_header.bpp != 24 || + dib_header.compression != 0) + return false; + + width = dib_header.width; + height = abs (dib_header.height); + bmp_pitch = (3 * width + 3) & ~3; + + buf = malloc (bmp_pitch * height); + assert (buf); + + if (fseek (fp, file_header.bitmap_offset, SEEK_SET) != 0) + goto out; + + if (fread (buf, 1, bmp_pitch * height, fp) != bmp_pitch * height) + goto out; + + image->buffer = ply_pixel_buffer_new (width, height); + dst = ply_pixel_buffer_get_argb32_data (image->buffer); + + for (y = 0; y < height; y++) { + /* Positive header height means upside down row order */ + if (dib_header.height > 0) + src_y = (height - 1) - y; + else + src_y = y; + + src = buf + src_y * bmp_pitch; + + for (x = 0; x < width; x++) { + b = *src++; + g = *src++; + r = *src++; + *dst++ = (0xff << 24) | (r << 16) | (g << 8) | (b << 0); + } + } + + ply_pixel_buffer_set_opaque (image->buffer, true); + ret = true; +out: + free (buf); + return ret; +} + bool ply_image_load (ply_image_t *image) { @@ -212,6 +296,10 @@ ply_image_load (ply_image_t *image) if (memcmp (header, png_header, sizeof(png_header)) == 0) ret = ply_image_load_png (image, fp); + else if (((struct bmp_file_header *)header)->id == 0x4d42 && + ((struct bmp_file_header *)header)->reserved == 0) + ret = ply_image_load_bmp (image, fp); + out: fclose (fp); return ret; -- cgit v1.2.3 From 1723419e6c3ca89a973250ca8ca955baf8724af1 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 7 Nov 2018 12:24:12 +0100 Subject: ply-renderer: Add ply_renderer_get_panel_properties function For some themes we want to read the firmware-logo to use as background, when the LCD panel of a laptop is mounted non-upright and/or if it is using scaling because of HiDPI then the image which we get from the firmware will be pre-rotated and scaled to match the LCD panel. This new function will allow renderers to let themes know about this so that they can adjust for the logo being pre-rotated and scaled. Signed-off-by: Hans de Goede --- src/libply-splash-core/ply-renderer-plugin.h | 5 +++++ src/libply-splash-core/ply-renderer.c | 15 +++++++++++++++ src/libply-splash-core/ply-renderer.h | 6 ++++++ 3 files changed, 26 insertions(+) diff --git a/src/libply-splash-core/ply-renderer-plugin.h b/src/libply-splash-core/ply-renderer-plugin.h index f1455d30..db18d195 100644 --- a/src/libply-splash-core/ply-renderer-plugin.h +++ b/src/libply-splash-core/ply-renderer-plugin.h @@ -68,6 +68,11 @@ typedef struct ply_renderer_input_source_t *input_source); const char * (*get_device_name)(ply_renderer_backend_t *backend); + bool (*get_panel_properties)(ply_renderer_backend_t *backend, + int *width, + int *height, + ply_pixel_buffer_rotation_t *rotation, + int *scale); } ply_renderer_plugin_interface_t; #endif /* PLY_RENDERER_PLUGIN_H */ diff --git a/src/libply-splash-core/ply-renderer.c b/src/libply-splash-core/ply-renderer.c index ecf70822..5e83627a 100644 --- a/src/libply-splash-core/ply-renderer.c +++ b/src/libply-splash-core/ply-renderer.c @@ -410,4 +410,19 @@ ply_renderer_close_input_source (ply_renderer_t *renderer, renderer->input_source_is_open = false; } +bool +ply_renderer_get_panel_properties (ply_renderer_t *renderer, + int *width, + int *height, + ply_pixel_buffer_rotation_t *rotation, + int *scale) +{ + if (!renderer->plugin_interface->get_panel_properties) + return false; + + return renderer->plugin_interface->get_panel_properties (renderer->backend, + width, height, + rotation, scale); +} + /* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */ diff --git a/src/libply-splash-core/ply-renderer.h b/src/libply-splash-core/ply-renderer.h index 59391e17..c0e0ed59 100644 --- a/src/libply-splash-core/ply-renderer.h +++ b/src/libply-splash-core/ply-renderer.h @@ -76,6 +76,12 @@ void ply_renderer_set_handler_for_input_source (ply_renderer_t void ply_renderer_close_input_source (ply_renderer_t *renderer, ply_renderer_input_source_t *input_source); + +bool ply_renderer_get_panel_properties (ply_renderer_t *renderer, + int *width, + int *height, + ply_pixel_buffer_rotation_t *rotation, + int *scale); #endif #endif /* PLY_RENDERER_H */ -- cgit v1.2.3 From ed3aae9d8f79afb546cc9edeb8b051237c3e4752 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 7 Nov 2018 14:26:11 +0100 Subject: drm: Implement ply_renderer_get_panel_properties Implement the get_panel_properties plugin interface. Signed-off-by: Hans de Goede --- src/plugins/renderers/drm/plugin.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c index 1ff2b295..34b52d7b 100644 --- a/src/plugins/renderers/drm/plugin.c +++ b/src/plugins/renderers/drm/plugin.c @@ -138,6 +138,11 @@ struct _ply_renderer_backend uint32_t is_active : 1; uint32_t requires_explicit_flushing : 1; uint32_t use_preferred_mode : 1; + + int panel_width; + int panel_height; + ply_pixel_buffer_rotation_t panel_rotation; + int panel_scale; }; ply_renderer_plugin_interface_t *ply_renderer_backend_get_interface (void); @@ -542,6 +547,15 @@ ply_renderer_head_new (ply_renderer_backend_t *backend, ply_pixel_buffer_fill_with_color (head->pixel_buffer, NULL, 0.0, 0.0, 0.0, 1.0); + if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS || + connector->connector_type == DRM_MODE_CONNECTOR_eDP || + connector->connector_type == DRM_MODE_CONNECTOR_DSI) { + backend->panel_width = mode->hdisplay; + backend->panel_height = mode->vdisplay; + backend->panel_rotation = rotation; + backend->panel_scale = ply_pixel_buffer_get_device_scale (head->pixel_buffer); + } + return head; } @@ -1488,6 +1502,23 @@ close_input_source (ply_renderer_backend_t *backend, input_source->backend = NULL; } +static bool +get_panel_properties (ply_renderer_backend_t *backend, + int *width, + int *height, + ply_pixel_buffer_rotation_t *rotation, + int *scale) +{ + if (!backend->panel_width) + return false; + + *width = backend->panel_width; + *height = backend->panel_height; + *rotation = backend->panel_rotation; + *scale = backend->panel_scale; + return true; +} + ply_renderer_plugin_interface_t * ply_renderer_backend_get_interface (void) { @@ -1509,7 +1540,8 @@ ply_renderer_backend_get_interface (void) .open_input_source = open_input_source, .set_handler_for_input_source = set_handler_for_input_source, .close_input_source = close_input_source, - .get_device_name = get_device_name + .get_device_name = get_device_name, + .get_panel_properties = get_panel_properties, }; return &plugin_interface; -- cgit v1.2.3 From 986c911e21b41464aa17006fd048dc38d5824325 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 7 Nov 2018 15:49:40 +0100 Subject: ply-pixel-buffer: Fix fill_with_buffer fastpath when device_scale != 1 After calling ply_pixel_buffer_crop_area_to_clip_area cropped_area.x/y are in device coordinates. So when calculating the x/y offset in the source-buffer due to device-clip areas possible making cropped_area.x/y larger then just the xoffset/yoffset (in the canvas) we must multiply the original xoffset/yoffset by device_scale before subtracting. Signed-off-by: Hans de Goede --- src/libply-splash-core/ply-pixel-buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libply-splash-core/ply-pixel-buffer.c b/src/libply-splash-core/ply-pixel-buffer.c index de3b1079..04aa0d66 100644 --- a/src/libply-splash-core/ply-pixel-buffer.c +++ b/src/libply-splash-core/ply-pixel-buffer.c @@ -868,8 +868,8 @@ ply_pixel_buffer_fill_with_buffer_at_opacity_with_clip (ply_pixel_buffer_t *canv if (cropped_area.width == 0 || cropped_area.height == 0) return; - x = cropped_area.x - x_offset; - y = cropped_area.y - y_offset; + x = cropped_area.x - x_offset * canvas->device_scale; + y = cropped_area.y - y_offset * canvas->device_scale; ply_pixel_buffer_copy_area (canvas, source, x, y, &cropped_area); -- cgit v1.2.3 From e1e9e554d2014d80ce666d85174dbea89b05e038 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 9 Nov 2018 23:05:24 +0100 Subject: ply-pixel-buffer: Fix marking buffers as opaque when doing a solid fill Instead of comparing fill_area addresses actually compare the contents of the ply_rectangles. This allows us to use the memcpy fastpath in ply_pixel_buffer_with_buffer more often. Signed-off-by: Hans de Goede --- src/libply-splash-core/ply-pixel-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libply-splash-core/ply-pixel-buffer.c b/src/libply-splash-core/ply-pixel-buffer.c index 04aa0d66..86e8e3f0 100644 --- a/src/libply-splash-core/ply-pixel-buffer.c +++ b/src/libply-splash-core/ply-pixel-buffer.c @@ -315,7 +315,7 @@ ply_pixel_buffer_fill_area_with_pixel_value (ply_pixel_buffer_t *buffer, /* If we're filling the entire buffer with a fully opaque color, * then make note of it */ - if (fill_area == &buffer->area && + if (memcmp(fill_area, &buffer->area, sizeof(ply_rectangle_t)) == 0 && (pixel_value >> 24) == 0xff) { buffer->is_opaque = true; } -- cgit v1.2.3 From 385a008c83e41d7958392bc4cf8aacb94965fe30 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 6 Nov 2018 18:55:27 +0100 Subject: ply-pixel-buffer: Add ply_pixel_buffer_get/set_device_rotation helpers For some themes we want to use the firmware-logo / splash as background, when the LCD panel of a laptop is mounted non-upright then the image which we get from the firmware will be pre-rotated to match the LCD panel mount. This commit adds ply_pixel_buffer_set/get_device_rotation helpers to help deal with this. Signed-off-by: Hans de Goede --- src/libply-splash-core/ply-pixel-buffer.c | 30 ++++++++++++++++++++++++++++++ src/libply-splash-core/ply-pixel-buffer.h | 6 ++++++ 2 files changed, 36 insertions(+) diff --git a/src/libply-splash-core/ply-pixel-buffer.c b/src/libply-splash-core/ply-pixel-buffer.c index 86e8e3f0..1599bcb5 100644 --- a/src/libply-splash-core/ply-pixel-buffer.c +++ b/src/libply-splash-core/ply-pixel-buffer.c @@ -1079,4 +1079,34 @@ ply_pixel_buffer_set_device_scale (ply_pixel_buffer_t *buffer, buffer->logical_area.height = buffer->area.height / scale; } +ply_pixel_buffer_rotation_t +ply_pixel_buffer_get_device_rotation (ply_pixel_buffer_t *buffer) +{ + return buffer->device_rotation; +} + +void +ply_pixel_buffer_set_device_rotation (ply_pixel_buffer_t *buffer, + ply_pixel_buffer_rotation_t device_rotation) +{ + if (buffer->device_rotation == device_rotation) + return; + + buffer->device_rotation = device_rotation; + + if (device_rotation == PLY_PIXEL_BUFFER_ROTATE_CLOCKWISE || + device_rotation == PLY_PIXEL_BUFFER_ROTATE_COUNTER_CLOCKWISE) { + unsigned long tmp = buffer->area.width; + buffer->area.width = buffer->area.height; + buffer->area.height = tmp; + + ply_pixel_buffer_set_device_scale (buffer, buffer->device_scale); + } + + while (ply_list_get_length (buffer->clip_areas) > 0) { + ply_pixel_buffer_pop_clip_area (buffer); + } + ply_pixel_buffer_push_clip_area (buffer, &buffer->area); +} + /* vim: set ts=4 sw=4 et ai ci cino={.5s,^-2,+.5s,t0,g0,e-2,n-2,p2s,(0,=.5s,:.5s */ diff --git a/src/libply-splash-core/ply-pixel-buffer.h b/src/libply-splash-core/ply-pixel-buffer.h index ea7f833d..ddec47d1 100644 --- a/src/libply-splash-core/ply-pixel-buffer.h +++ b/src/libply-splash-core/ply-pixel-buffer.h @@ -59,6 +59,12 @@ int ply_pixel_buffer_get_device_scale (ply_pixel_buffer_t *buffer); void ply_pixel_buffer_set_device_scale (ply_pixel_buffer_t *buffer, int scale); +ply_pixel_buffer_rotation_t +ply_pixel_buffer_get_device_rotation (ply_pixel_buffer_t *buffer); +/* Note calling this removes all pushed clip-areas */ +void ply_pixel_buffer_set_device_rotation (ply_pixel_buffer_t *buffer, + ply_pixel_buffer_rotation_t rotation); + unsigned long ply_pixel_buffer_get_width (ply_pixel_buffer_t *buffer); unsigned long ply_pixel_buffer_get_height (ply_pixel_buffer_t *buffer); -- cgit v1.2.3 From 3f71c28e455ea26c23ab924146dae0871b342732 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 8 Nov 2018 14:25:05 +0100 Subject: ply-pixel-buffer: Add ply_pixel_buffer_rotate_upright helper For some themes we want to use the firmware-logo / splash as background, when the LCD panel of a laptop is mounted non-upright then the image which we get from the firmware will be pre-rotated to match the LCD panel mount. Until now our device-rotation support was limited to using rotated pixel_buffer-s as destination / canvas only. This commit adds a ply_pixel_buffer_rotate_upright helper to rotate a nop-upright source buffer upright so that we can use it as source-buffer to other functions which expect source-buffers to always be upright. Signed-off-by: Hans de Goede --- src/libply-splash-core/ply-pixel-buffer.c | 25 +++++++++++++++++++++++++ src/libply-splash-core/ply-pixel-buffer.h | 6 ++++++ 2 files changed, 31 insertions(+) diff --git a/src/libply-splash-core/ply-pixel-buffer.c b/src/libply-splash-core/ply-pixel-buffer.c index 1599bcb5..3ce6f78f 100644 --- a/src/libply-splash-core/ply-pixel-buffer.c +++ b/src/libply-splash-core/ply-pixel-buffer.c @@ -1109,4 +1109,29 @@ ply_pixel_buffer_set_device_rotation (ply_pixel_buffer_t *buffer, ply_pixel_buffer_push_clip_area (buffer, &buffer->area); } +ply_pixel_buffer_t * +ply_pixel_buffer_rotate_upright (ply_pixel_buffer_t *old_buffer) +{ + ply_pixel_buffer_t *buffer; + int x,y, width, height; + uint32_t pixel; + + width = old_buffer->area.width; + height = old_buffer->area.height; + + buffer = ply_pixel_buffer_new (width, height); + + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + pixel = ply_pixel_buffer_get_pixel (old_buffer, x, y); + ply_pixel_buffer_set_pixel (buffer, x, y, pixel); + } + } + + ply_pixel_buffer_set_device_scale (buffer, old_buffer->device_scale); + ply_pixel_buffer_set_opaque (buffer, old_buffer->is_opaque); + + return buffer; +} + /* vim: set ts=4 sw=4 et ai ci cino={.5s,^-2,+.5s,t0,g0,e-2,n-2,p2s,(0,=.5s,:.5s */ diff --git a/src/libply-splash-core/ply-pixel-buffer.h b/src/libply-splash-core/ply-pixel-buffer.h index ddec47d1..7b5da364 100644 --- a/src/libply-splash-core/ply-pixel-buffer.h +++ b/src/libply-splash-core/ply-pixel-buffer.h @@ -159,6 +159,12 @@ ply_pixel_buffer_t *ply_pixel_buffer_tile (ply_pixel_buffer_t *old_buffer, long width, long height); +/* Return the upright version of a buffer which is non upright. + * This is the *only* ply_pixel_buffer function which works correctly with a + * non upright buffer as source. + */ +ply_pixel_buffer_t *ply_pixel_buffer_rotate_upright (ply_pixel_buffer_t *old_buffer); + #endif #endif /* PLY_PIXEL_BUFFER_H */ -- cgit v1.2.3 From ae8a676c096731e6ad0868e80c53e23ba82c0695 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 7 Nov 2018 15:46:06 +0100 Subject: ply-pixel-display: Add ply_pixel_display_get_device_scale() function Add a function to get the device scale for a ply-pixel-display. Signed-off-by: Hans de Goede --- src/libply-splash-core/ply-pixel-display.c | 8 ++++++++ src/libply-splash-core/ply-pixel-display.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/libply-splash-core/ply-pixel-display.c b/src/libply-splash-core/ply-pixel-display.c index cb01a2c6..dc088bb6 100644 --- a/src/libply-splash-core/ply-pixel-display.c +++ b/src/libply-splash-core/ply-pixel-display.c @@ -51,6 +51,7 @@ struct _ply_pixel_display unsigned long width; unsigned long height; + int device_scale; ply_pixel_display_draw_handler_t draw_handler; void *draw_handler_user_data; @@ -77,6 +78,7 @@ ply_pixel_display_new (ply_renderer_t *renderer, display->width = size.width; display->height = size.height; + display->device_scale = ply_pixel_buffer_get_device_scale (pixel_buffer); return display; } @@ -105,6 +107,12 @@ ply_pixel_display_get_height (ply_pixel_display_t *display) return display->height; } +int +ply_pixel_display_get_device_scale (ply_pixel_display_t *display) +{ + return display->device_scale; +} + static void ply_pixel_display_flush (ply_pixel_display_t *display) { diff --git a/src/libply-splash-core/ply-pixel-display.h b/src/libply-splash-core/ply-pixel-display.h index 675c181d..a57b9a9a 100644 --- a/src/libply-splash-core/ply-pixel-display.h +++ b/src/libply-splash-core/ply-pixel-display.h @@ -51,6 +51,7 @@ ply_renderer_head_t *ply_pixel_display_get_renderer_head (ply_pixel_display_t *d unsigned long ply_pixel_display_get_width (ply_pixel_display_t *display); unsigned long ply_pixel_display_get_height (ply_pixel_display_t *display); +int ply_pixel_display_get_device_scale (ply_pixel_display_t *display); void ply_pixel_display_set_draw_handler (ply_pixel_display_t *display, ply_pixel_display_draw_handler_t draw_handler, -- cgit v1.2.3 From 9f3aff2e7c5ad70b37c779c06509c8d1c74a6e58 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 6 Nov 2018 14:41:38 +0100 Subject: two-step: Use a pixel-buffer instead of an image for the view's background Use a pixel-buffer instead of an image, this gives us more flexibility. This is a preparation patch for adding support to (optionally) use the firmware splash screen logo (from the ACPI BGRT extension) as background. Signed-off-by: Hans de Goede --- src/plugins/splash/two-step/plugin.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 0ceda904..efdcaa90 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -93,7 +93,7 @@ typedef struct ply_label_t *message_label; ply_rectangle_t box_area, lock_area, watermark_area; ply_trigger_t *end_trigger; - ply_image_t *background_image; + ply_pixel_buffer_t *background_buffer; } view_t; struct _ply_boot_splash_plugin @@ -181,8 +181,8 @@ view_free (view_t *view) ply_label_free (view->label); ply_label_free (view->message_label); - if (view->background_image != NULL) - ply_image_free (view->background_image); + if (view->background_buffer != NULL) + ply_pixel_buffer_free (view->background_buffer); free (view); } @@ -255,7 +255,7 @@ view_load (view_t *view) if (plugin->background_tile_image != NULL) { ply_trace ("tiling background to %lux%lu", screen_width, screen_height); - view->background_image = ply_image_tile (plugin->background_tile_image, screen_width, screen_height); + view->background_buffer = ply_pixel_buffer_tile (ply_image_get_buffer (plugin->background_tile_image), screen_width, screen_height); } if (plugin->watermark_image != NULL) { @@ -882,9 +882,9 @@ draw_background (view_t *view, ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area, plugin->background_start_color); - if (view->background_image != NULL) { + if (view->background_buffer != NULL) { uint32_t *data; - data = ply_image_get_data (view->background_image); + data = ply_pixel_buffer_get_argb32_data (view->background_buffer); /* We must pass NULL as fill area, because the fill area must be sized as the image we're sourcing from, otherwise -- cgit v1.2.3 From e10ed13fffb59b7a7656227c8f77b93310c160cd Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 7 Nov 2018 20:27:08 +0100 Subject: two-step: Speed up background-tile drawing on HiDPI screens Before this commit background drawing on HiDPI screens is quite slow and CPU intensive, because we do the interpolating scale, which does a whole bunch of double-precision float operations for *each* pixel for every frame we draw. When using two-step with a background-tile on a Cherry Trail machine with a HiDPI screen this results in the diskcrypt password entry being visible laggy, I can type the password much faster then the bullets show up. This also means we are pegging the CPU during boot, significantly slowing down the boot. This commit fixes this by creating the background_buffer at the screen's device_scale and rotation, only doing the scaling once. This commit further speeds things up by also doing the solid/gradient fill of the background + the alpha blend of the tiled background-image once, creating a solid background which allows us to hit the ply_pixel_buffer_fill_with_buffer memcpy fast-path and avoids the need to re-do the solid/gradient fill + alpha-blend each frame we render. Signed-off-by: Hans de Goede --- src/plugins/splash/two-step/plugin.c | 40 +++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index efdcaa90..65586f94 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -245,17 +245,38 @@ view_load_end_animation (view_t *view) static bool view_load (view_t *view) { - unsigned long screen_width, screen_height; + unsigned long screen_width, screen_height, screen_scale; ply_boot_splash_plugin_t *plugin; + ply_pixel_buffer_t *buffer; plugin = view->plugin; screen_width = ply_pixel_display_get_width (view->display); screen_height = ply_pixel_display_get_height (view->display); + buffer = ply_renderer_get_buffer_for_head( + ply_pixel_display_get_renderer (view->display), + ply_pixel_display_get_renderer_head (view->display)); + screen_scale = ply_pixel_buffer_get_device_scale (buffer); + if (plugin->background_tile_image != NULL) { ply_trace ("tiling background to %lux%lu", screen_width, screen_height); - view->background_buffer = ply_pixel_buffer_tile (ply_image_get_buffer (plugin->background_tile_image), screen_width, screen_height); + + /* Create a buffer at screen scale so that we only do the slow interpolating scale once */ + view->background_buffer = ply_pixel_buffer_new (screen_width * screen_scale, screen_height * screen_scale); + ply_pixel_buffer_set_device_scale (view->background_buffer, screen_scale); + + if (plugin->background_start_color != plugin->background_end_color) + ply_pixel_buffer_fill_with_gradient (view->background_buffer, NULL, + plugin->background_start_color, + plugin->background_end_color); + else + 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); + ply_pixel_buffer_fill_with_buffer (view->background_buffer, buffer, 0, 0); + ply_pixel_buffer_free (buffer); } if (plugin->watermark_image != NULL) { @@ -874,7 +895,9 @@ draw_background (view_t *view, area.width = width; area.height = height; - if (plugin->background_start_color != plugin->background_end_color) + if (view->background_buffer != NULL) + ply_pixel_buffer_fill_with_buffer (pixel_buffer, view->background_buffer, 0, 0); + else if (plugin->background_start_color != plugin->background_end_color) ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area, plugin->background_start_color, plugin->background_end_color); @@ -882,17 +905,6 @@ draw_background (view_t *view, ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area, plugin->background_start_color); - if (view->background_buffer != NULL) { - uint32_t *data; - data = ply_pixel_buffer_get_argb32_data (view->background_buffer); - - /* We must pass NULL as fill area, because the fill area - must be sized as the image we're sourcing from, otherwise - sampling does not work - */ - ply_pixel_buffer_fill_with_argb32_data_with_clip (pixel_buffer, NULL, NULL, data); - } - if (plugin->watermark_image != NULL) { uint32_t *data; -- cgit v1.2.3 From 856297c7a4bc8dff5b3d03951b250d9620468f9a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 6 Nov 2018 14:55:29 +0100 Subject: two-step: Add ACPI BGRT extension support Add support to (optionally) use the firmware splash screen logo from the ACPI BGRT extension as background. Signed-off-by: Hans de Goede --- src/plugins/splash/two-step/plugin.c | 86 +++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 2 deletions(-) diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 65586f94..35701828 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -94,6 +94,7 @@ typedef struct ply_rectangle_t box_area, lock_area, watermark_area; ply_trigger_t *end_trigger; ply_pixel_buffer_t *background_buffer; + bool background_is_bgrt; } view_t; struct _ply_boot_splash_plugin @@ -105,6 +106,7 @@ struct _ply_boot_splash_plugin ply_image_t *corner_image; ply_image_t *header_image; ply_image_t *background_tile_image; + ply_image_t *background_bgrt_image; ply_image_t *watermark_image; ply_list_t *views; @@ -242,6 +244,62 @@ view_load_end_animation (view_t *view) view->end_animation = NULL; } +/* The Microsoft boot logo spec says that the logo must use a black background + * and have its center at 38.2% from the screen's top (golden ratio). + * We reproduce this exactly here so that we get a background which is an exact + * match of the firmware's boot splash. + * At the time of writing this comment this is documented in a document called + * "Boot screen components" which is available here: + * https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/boot-screen-components + * Note that we normally do not use the firmware reported x and y-offset as + * that is based on the EFI fb resolution which may not be the native + * resolution of the screen (esp. when using multiple heads). + */ +static void +view_set_bgrt_background (view_t *view) +{ + ply_pixel_buffer_rotation_t panel_rotation = PLY_PIXEL_BUFFER_ROTATE_UPRIGHT; + int x_offset, y_offset, sysfs_x_offset, sysfs_y_offset, width, height; + int panel_width = 0, panel_height = 0, panel_scale = 1; + int screen_width, screen_height, screen_scale; + ply_pixel_buffer_t *bgrt_buffer; + + if (!view->plugin->background_bgrt_image) + return; + + screen_width = ply_pixel_display_get_width (view->display); + screen_height = ply_pixel_display_get_height (view->display); + screen_scale = ply_pixel_display_get_device_scale (view->display); + + bgrt_buffer = ply_image_get_buffer (view->plugin->background_bgrt_image); + + if (ply_renderer_get_panel_properties (ply_pixel_display_get_renderer (view->display), + &panel_width, &panel_height, + &panel_rotation, &panel_scale)) { + ply_pixel_buffer_set_device_rotation (bgrt_buffer, panel_rotation); + ply_pixel_buffer_set_device_scale (bgrt_buffer, panel_scale); + } + + width = ply_pixel_buffer_get_width (bgrt_buffer); + height = ply_pixel_buffer_get_height (bgrt_buffer); + + x_offset = (screen_width - width) / 2; + y_offset = screen_height * 382 / 1000 - height / 2; + + ply_trace ("using %dx%d bgrt image centered at %dx%d for %dx%d screen", + width, height, x_offset, y_offset, screen_width, screen_height); + + view->background_buffer = ply_pixel_buffer_new (screen_width * screen_scale, screen_height * screen_scale); + ply_pixel_buffer_set_device_scale (view->background_buffer, screen_scale); + ply_pixel_buffer_fill_with_hex_color (view->background_buffer, NULL, 0x000000); + if (x_offset >= 0 && y_offset >= 0) { + bgrt_buffer = ply_pixel_buffer_rotate_upright (bgrt_buffer); + ply_pixel_buffer_fill_with_buffer (view->background_buffer, bgrt_buffer, x_offset, y_offset); + ply_pixel_buffer_free (bgrt_buffer); + } + view->background_is_bgrt = true; +} + static bool view_load (view_t *view) { @@ -259,7 +317,9 @@ view_load (view_t *view) ply_pixel_display_get_renderer_head (view->display)); screen_scale = ply_pixel_buffer_get_device_scale (buffer); - if (plugin->background_tile_image != NULL) { + view_set_bgrt_background (view); + + if (!view->background_buffer && plugin->background_tile_image != NULL) { ply_trace ("tiling background to %lux%lu", screen_width, screen_height); /* Create a buffer at screen scale so that we only do the slow interpolating scale once */ @@ -670,6 +730,10 @@ create_plugin (ply_key_file_t *key_file) free (color); + /* Boolean option, true if the key is present */ + if (ply_key_file_get_value (key_file, "two-step", "UseBGRT")) + plugin->background_bgrt_image = ply_image_new ("/sys/firmware/acpi/bgrt/image"); + progress_function = ply_key_file_get_value (key_file, "two-step", "ProgressFunction"); if (progress_function != NULL) { @@ -747,6 +811,9 @@ destroy_plugin (ply_boot_splash_plugin_t *plugin) if (plugin->background_tile_image != NULL) ply_image_free (plugin->background_tile_image); + if (plugin->background_bgrt_image != NULL) + ply_image_free (plugin->background_bgrt_image); + if (plugin->watermark_image != NULL) ply_image_free (plugin->watermark_image); @@ -895,7 +962,14 @@ draw_background (view_t *view, area.width = width; area.height = height; - if (view->background_buffer != NULL) + /* When using the firmware logo as background, use solid black as + * background for dialogs. + */ + if ((plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY || + plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) && + view->background_is_bgrt) + ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area, 0); + else if (view->background_buffer != NULL) ply_pixel_buffer_fill_with_buffer (pixel_buffer, view->background_buffer, 0, 0); else if (plugin->background_start_color != plugin->background_end_color) ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area, @@ -1097,6 +1171,14 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin, } } + if (plugin->background_bgrt_image != NULL) { + ply_trace ("loading background bgrt image"); + if (!ply_image_load (plugin->background_bgrt_image)) { + ply_image_free (plugin->background_bgrt_image); + plugin->background_bgrt_image = NULL; + } + } + if (plugin->watermark_image != NULL) { ply_trace ("loading watermark image"); if (!ply_image_load (plugin->watermark_image)) { -- cgit v1.2.3 From d45c477d44e9d352e9d91686237e26474ab009d7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 13 Nov 2018 09:03:10 +0100 Subject: two-step: bgrt: Deal with quirky firmwares On laptops / tablets the LCD panel is typically brought up in its native resolution, so we can trust the x- and y-offset values provided by the firmware to be correct for a screen with the panels resolution. Moreover some laptop / tablet firmwares to do all kind of hacks wrt the y-offset. This happens especially on devices where the panel is mounted 90 degrees rotated, but also on other devices. So on devices with an internal LCD panel, we prefer to use the firmware provided offsets, to make sure we match its quirky behavior. We check that the x-offset matches what we expect for the panel's native resolution to make sure that the values are indeed for the panel's native resolution and then we correct for any difference between the (external) screen's and the panel's resolution. Signed-off-by: Hans de Goede --- src/plugins/splash/two-step/plugin.c | 79 +++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 35701828..641eb703 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -124,6 +124,7 @@ struct _ply_boot_splash_plugin uint32_t background_start_color; uint32_t background_end_color; + int background_bgrt_raw_width; progress_function_t progress_function; @@ -244,6 +245,41 @@ view_load_end_animation (view_t *view) view->end_animation = NULL; } +static bool +get_bgrt_sysfs_offsets(int *x_offset, int *y_offset) +{ + bool ret = false; + char buf[64]; + FILE *f; + + f = fopen("/sys/firmware/acpi/bgrt/xoffset", "r"); + if (!f) + return false; + + if (!fgets(buf, sizeof(buf), f)) + goto out; + + if (sscanf(buf, "%d", x_offset) != 1) + goto out; + + fclose(f); + + f = fopen("/sys/firmware/acpi/bgrt/yoffset", "r"); + if (!f) + return false; + + if (!fgets(buf, sizeof(buf), f)) + goto out; + + if (sscanf(buf, "%d", y_offset) != 1) + goto out; + + ret = true; +out: + fclose(f); + return ret; +} + /* The Microsoft boot logo spec says that the logo must use a black background * and have its center at 38.2% from the screen's top (golden ratio). * We reproduce this exactly here so that we get a background which is an exact @@ -286,6 +322,45 @@ view_set_bgrt_background (view_t *view) x_offset = (screen_width - width) / 2; y_offset = screen_height * 382 / 1000 - height / 2; + /* + * On laptops / tablets the LCD panel is typically brought up in + * its native resolution, so we can trust the x- and y-offset values + * provided by the firmware to be correct for a screen with the panels + * resolution. + * + * Moreover some laptop / tablet firmwares to do all kind of hacks wrt + * the y offset. This happens especially on devices where the panel is + * mounted 90 degrees rotated, but also on other devices. + * + * So on devices with an internal LCD panel, we prefer to use the + * firmware provided offsets, to make sure we match its quirky behavior. + * + * We check that the x-offset matches what we expect for the panel's + * native resolution to make sure that the values are indeed for the + * panel's native resolution and then we correct for any difference + * between the (external) screen's and the panel's resolution. + */ + if (panel_width != 0 && panel_height != 0 && + get_bgrt_sysfs_offsets(&sysfs_x_offset, &sysfs_y_offset) && + (panel_width - view->plugin->background_bgrt_raw_width) / 2 == sysfs_x_offset) { + if (panel_rotation == PLY_PIXEL_BUFFER_ROTATE_CLOCKWISE || + panel_rotation == PLY_PIXEL_BUFFER_ROTATE_COUNTER_CLOCKWISE) { + /* 90 degrees rotated, swap x and y */ + x_offset = sysfs_y_offset / panel_scale; + y_offset = sysfs_x_offset / panel_scale; + + x_offset += (screen_width - panel_height / panel_scale) / 2; + y_offset += (screen_height - panel_width / panel_scale) * 382 / 1000; + } else { + /* Normal orientation */ + x_offset = sysfs_x_offset / panel_scale; + y_offset = sysfs_y_offset / panel_scale; + + x_offset += (screen_width - panel_width / panel_scale) / 2; + y_offset += (screen_height - panel_height / panel_scale) * 382 / 1000; + } + } + ply_trace ("using %dx%d bgrt image centered at %dx%d for %dx%d screen", width, height, x_offset, y_offset, screen_width, screen_height); @@ -1173,7 +1248,9 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin, if (plugin->background_bgrt_image != NULL) { ply_trace ("loading background bgrt image"); - if (!ply_image_load (plugin->background_bgrt_image)) { + if (ply_image_load (plugin->background_bgrt_image)) { + plugin->background_bgrt_raw_width = ply_image_get_width (plugin->background_bgrt_image); + } else { ply_image_free (plugin->background_bgrt_image); plugin->background_bgrt_image = NULL; } -- cgit v1.2.3 From 4925a485c56fec0bd1333ec94d99b9c0e5b769b4 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 13 Nov 2018 09:51:32 +0100 Subject: themes: Add new BGRT theme, using the firmware boot splash as background Add a new BGRT theme, this is a copy of the spinner theme, using the ACPI BGRT graphics (firmware boot splash) as logo when available. Signed-off-by: Hans de Goede --- configure.ac | 1 + themes/Makefile.am | 2 +- themes/bgrt/Makefile.am | 84 ++++++++++++++++++++++++++++++++++++++++ themes/bgrt/animation-0001.png | Bin 0 -> 1579 bytes themes/bgrt/animation-0002.png | Bin 0 -> 1573 bytes themes/bgrt/animation-0003.png | Bin 0 -> 1591 bytes themes/bgrt/animation-0004.png | Bin 0 -> 1594 bytes themes/bgrt/animation-0005.png | Bin 0 -> 1624 bytes themes/bgrt/animation-0006.png | Bin 0 -> 1646 bytes themes/bgrt/animation-0007.png | Bin 0 -> 1666 bytes themes/bgrt/animation-0008.png | Bin 0 -> 1634 bytes themes/bgrt/animation-0009.png | Bin 0 -> 1640 bytes themes/bgrt/animation-0010.png | Bin 0 -> 1613 bytes themes/bgrt/animation-0011.png | Bin 0 -> 1621 bytes themes/bgrt/animation-0012.png | Bin 0 -> 1619 bytes themes/bgrt/animation-0013.png | Bin 0 -> 1617 bytes themes/bgrt/animation-0014.png | Bin 0 -> 1618 bytes themes/bgrt/animation-0015.png | Bin 0 -> 1615 bytes themes/bgrt/animation-0016.png | Bin 0 -> 1605 bytes themes/bgrt/animation-0017.png | Bin 0 -> 1581 bytes themes/bgrt/animation-0018.png | Bin 0 -> 1582 bytes themes/bgrt/animation-0019.png | Bin 0 -> 1578 bytes themes/bgrt/animation-0020.png | Bin 0 -> 1558 bytes themes/bgrt/animation-0021.png | Bin 0 -> 1545 bytes themes/bgrt/animation-0022.png | Bin 0 -> 1541 bytes themes/bgrt/animation-0023.png | Bin 0 -> 1481 bytes themes/bgrt/animation-0024.png | Bin 0 -> 1492 bytes themes/bgrt/animation-0025.png | Bin 0 -> 1455 bytes themes/bgrt/animation-0026.png | Bin 0 -> 1427 bytes themes/bgrt/animation-0027.png | Bin 0 -> 1407 bytes themes/bgrt/animation-0028.png | Bin 0 -> 1385 bytes themes/bgrt/animation-0029.png | Bin 0 -> 1348 bytes themes/bgrt/animation-0030.png | Bin 0 -> 1316 bytes themes/bgrt/animation-0031.png | Bin 0 -> 1245 bytes themes/bgrt/animation-0032.png | Bin 0 -> 1185 bytes themes/bgrt/animation-0033.png | Bin 0 -> 1111 bytes themes/bgrt/animation-0034.png | Bin 0 -> 1061 bytes themes/bgrt/animation-0035.png | Bin 0 -> 981 bytes themes/bgrt/animation-0036.png | Bin 0 -> 989 bytes themes/bgrt/background-tile.png | Bin 0 -> 79464 bytes themes/bgrt/bgrt.plymouth.in | 16 ++++++++ themes/bgrt/box.png | Bin 0 -> 870 bytes themes/bgrt/bullet.png | Bin 0 -> 131 bytes themes/bgrt/entry.png | Bin 0 -> 1431 bytes themes/bgrt/lock.png | Bin 0 -> 329 bytes themes/bgrt/throbber-0001.png | Bin 0 -> 1578 bytes themes/bgrt/throbber-0002.png | Bin 0 -> 1568 bytes themes/bgrt/throbber-0003.png | Bin 0 -> 1561 bytes themes/bgrt/throbber-0004.png | Bin 0 -> 1570 bytes themes/bgrt/throbber-0005.png | Bin 0 -> 1585 bytes themes/bgrt/throbber-0006.png | Bin 0 -> 1597 bytes themes/bgrt/throbber-0007.png | Bin 0 -> 1629 bytes themes/bgrt/throbber-0008.png | Bin 0 -> 1604 bytes themes/bgrt/throbber-0009.png | Bin 0 -> 1605 bytes themes/bgrt/throbber-0010.png | Bin 0 -> 1601 bytes themes/bgrt/throbber-0011.png | Bin 0 -> 1595 bytes themes/bgrt/throbber-0012.png | Bin 0 -> 1602 bytes themes/bgrt/throbber-0013.png | Bin 0 -> 1612 bytes themes/bgrt/throbber-0014.png | Bin 0 -> 1601 bytes themes/bgrt/throbber-0015.png | Bin 0 -> 1588 bytes themes/bgrt/throbber-0016.png | Bin 0 -> 1577 bytes themes/bgrt/throbber-0017.png | Bin 0 -> 1572 bytes themes/bgrt/throbber-0018.png | Bin 0 -> 1601 bytes themes/bgrt/throbber-0019.png | Bin 0 -> 1608 bytes themes/bgrt/throbber-0020.png | Bin 0 -> 1583 bytes themes/bgrt/throbber-0021.png | Bin 0 -> 1602 bytes themes/bgrt/throbber-0022.png | Bin 0 -> 1595 bytes themes/bgrt/throbber-0023.png | Bin 0 -> 1603 bytes themes/bgrt/throbber-0024.png | Bin 0 -> 1605 bytes themes/bgrt/throbber-0025.png | Bin 0 -> 1604 bytes themes/bgrt/throbber-0026.png | Bin 0 -> 1605 bytes themes/bgrt/throbber-0027.png | Bin 0 -> 1615 bytes themes/bgrt/throbber-0028.png | Bin 0 -> 1614 bytes themes/bgrt/throbber-0029.png | Bin 0 -> 1588 bytes themes/bgrt/throbber-0030.png | Bin 0 -> 1580 bytes 75 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 themes/bgrt/Makefile.am create mode 100644 themes/bgrt/animation-0001.png create mode 100644 themes/bgrt/animation-0002.png create mode 100644 themes/bgrt/animation-0003.png create mode 100644 themes/bgrt/animation-0004.png create mode 100644 themes/bgrt/animation-0005.png create mode 100644 themes/bgrt/animation-0006.png create mode 100644 themes/bgrt/animation-0007.png create mode 100644 themes/bgrt/animation-0008.png create mode 100644 themes/bgrt/animation-0009.png create mode 100644 themes/bgrt/animation-0010.png create mode 100644 themes/bgrt/animation-0011.png create mode 100644 themes/bgrt/animation-0012.png create mode 100644 themes/bgrt/animation-0013.png create mode 100644 themes/bgrt/animation-0014.png create mode 100644 themes/bgrt/animation-0015.png create mode 100644 themes/bgrt/animation-0016.png create mode 100644 themes/bgrt/animation-0017.png create mode 100644 themes/bgrt/animation-0018.png create mode 100644 themes/bgrt/animation-0019.png create mode 100644 themes/bgrt/animation-0020.png create mode 100644 themes/bgrt/animation-0021.png create mode 100644 themes/bgrt/animation-0022.png create mode 100644 themes/bgrt/animation-0023.png create mode 100644 themes/bgrt/animation-0024.png create mode 100644 themes/bgrt/animation-0025.png create mode 100644 themes/bgrt/animation-0026.png create mode 100644 themes/bgrt/animation-0027.png create mode 100644 themes/bgrt/animation-0028.png create mode 100644 themes/bgrt/animation-0029.png create mode 100644 themes/bgrt/animation-0030.png create mode 100644 themes/bgrt/animation-0031.png create mode 100644 themes/bgrt/animation-0032.png create mode 100644 themes/bgrt/animation-0033.png create mode 100644 themes/bgrt/animation-0034.png create mode 100644 themes/bgrt/animation-0035.png create mode 100644 themes/bgrt/animation-0036.png create mode 100644 themes/bgrt/background-tile.png create mode 100644 themes/bgrt/bgrt.plymouth.in create mode 100644 themes/bgrt/box.png create mode 100644 themes/bgrt/bullet.png create mode 100644 themes/bgrt/entry.png create mode 100644 themes/bgrt/lock.png create mode 100644 themes/bgrt/throbber-0001.png create mode 100644 themes/bgrt/throbber-0002.png create mode 100644 themes/bgrt/throbber-0003.png create mode 100644 themes/bgrt/throbber-0004.png create mode 100644 themes/bgrt/throbber-0005.png create mode 100644 themes/bgrt/throbber-0006.png create mode 100644 themes/bgrt/throbber-0007.png create mode 100644 themes/bgrt/throbber-0008.png create mode 100644 themes/bgrt/throbber-0009.png create mode 100644 themes/bgrt/throbber-0010.png create mode 100644 themes/bgrt/throbber-0011.png create mode 100644 themes/bgrt/throbber-0012.png create mode 100644 themes/bgrt/throbber-0013.png create mode 100644 themes/bgrt/throbber-0014.png create mode 100644 themes/bgrt/throbber-0015.png create mode 100644 themes/bgrt/throbber-0016.png create mode 100644 themes/bgrt/throbber-0017.png create mode 100644 themes/bgrt/throbber-0018.png create mode 100644 themes/bgrt/throbber-0019.png create mode 100644 themes/bgrt/throbber-0020.png create mode 100644 themes/bgrt/throbber-0021.png create mode 100644 themes/bgrt/throbber-0022.png create mode 100644 themes/bgrt/throbber-0023.png create mode 100644 themes/bgrt/throbber-0024.png create mode 100644 themes/bgrt/throbber-0025.png create mode 100644 themes/bgrt/throbber-0026.png create mode 100644 themes/bgrt/throbber-0027.png create mode 100644 themes/bgrt/throbber-0028.png create mode 100644 themes/bgrt/throbber-0029.png create mode 100644 themes/bgrt/throbber-0030.png diff --git a/configure.ac b/configure.ac index 66d36493..78550d08 100644 --- a/configure.ac +++ b/configure.ac @@ -322,6 +322,7 @@ AC_CONFIG_FILES([Makefile themes/glow/Makefile themes/spinner/Makefile themes/script/Makefile + themes/bgrt/Makefile images/Makefile scripts/plymouth-generate-initrd scripts/plymouth-populate-initrd diff --git a/themes/Makefile.am b/themes/Makefile.am index 72e642bc..8e4566e9 100644 --- a/themes/Makefile.am +++ b/themes/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = spinfinity fade-in text details solar glow script spinner tribar +SUBDIRS = spinfinity fade-in text details solar glow script spinner tribar bgrt MAINTAINERCLEANFILES = Makefile.in diff --git a/themes/bgrt/Makefile.am b/themes/bgrt/Makefile.am new file mode 100644 index 00000000..4cb7aba9 --- /dev/null +++ b/themes/bgrt/Makefile.am @@ -0,0 +1,84 @@ +themedir = $(datadir)/plymouth/themes/bgrt +nodist_theme_DATA = bgrt.plymouth + +dist_theme_DATA = \ + background-tile.png \ + box.png \ + bullet.png \ + entry.png \ + lock.png \ + animation-0001.png \ + animation-0002.png \ + animation-0003.png \ + animation-0004.png \ + animation-0005.png \ + animation-0006.png \ + animation-0007.png \ + animation-0008.png \ + animation-0009.png \ + animation-0010.png \ + animation-0011.png \ + animation-0012.png \ + animation-0013.png \ + animation-0014.png \ + animation-0015.png \ + animation-0016.png \ + animation-0017.png \ + animation-0018.png \ + animation-0019.png \ + animation-0020.png \ + animation-0021.png \ + animation-0022.png \ + animation-0023.png \ + animation-0024.png \ + animation-0025.png \ + animation-0026.png \ + animation-0027.png \ + animation-0028.png \ + animation-0029.png \ + animation-0030.png \ + animation-0031.png \ + animation-0032.png \ + animation-0033.png \ + animation-0034.png \ + animation-0035.png \ + animation-0036.png \ + throbber-0001.png \ + throbber-0002.png \ + throbber-0003.png \ + throbber-0004.png \ + throbber-0005.png \ + throbber-0006.png \ + throbber-0007.png \ + throbber-0008.png \ + throbber-0009.png \ + throbber-0010.png \ + throbber-0011.png \ + throbber-0012.png \ + throbber-0013.png \ + throbber-0014.png \ + throbber-0015.png \ + throbber-0016.png \ + throbber-0017.png \ + throbber-0018.png \ + throbber-0019.png \ + throbber-0020.png \ + throbber-0021.png \ + throbber-0022.png \ + throbber-0023.png \ + throbber-0024.png \ + throbber-0025.png \ + throbber-0026.png \ + throbber-0027.png \ + throbber-0028.png \ + throbber-0029.png \ + throbber-0030.png + +MAINTAINERCLEANFILES = Makefile.in bgrt.plymouth +CLEANFILES = bgrt.plymouth + +bgrt.plymouth: $(srcdir)/bgrt.plymouth.in + sed -e 's,[@]PLYMOUTH_THEME_PATH[@],$(PLYMOUTH_THEME_PATH),g' \ + $(srcdir)/bgrt.plymouth.in > bgrt.plymouth + +EXTRA_DIST = bgrt.plymouth.in diff --git a/themes/bgrt/animation-0001.png b/themes/bgrt/animation-0001.png new file mode 100644 index 00000000..6bd82397 Binary files /dev/null and b/themes/bgrt/animation-0001.png differ diff --git a/themes/bgrt/animation-0002.png b/themes/bgrt/animation-0002.png new file mode 100644 index 00000000..ef8ff54a Binary files /dev/null and b/themes/bgrt/animation-0002.png differ diff --git a/themes/bgrt/animation-0003.png b/themes/bgrt/animation-0003.png new file mode 100644 index 00000000..205380b1 Binary files /dev/null and b/themes/bgrt/animation-0003.png differ diff --git a/themes/bgrt/animation-0004.png b/themes/bgrt/animation-0004.png new file mode 100644 index 00000000..6038af8b Binary files /dev/null and b/themes/bgrt/animation-0004.png differ diff --git a/themes/bgrt/animation-0005.png b/themes/bgrt/animation-0005.png new file mode 100644 index 00000000..7a967678 Binary files /dev/null and b/themes/bgrt/animation-0005.png differ diff --git a/themes/bgrt/animation-0006.png b/themes/bgrt/animation-0006.png new file mode 100644 index 00000000..eb0256f8 Binary files /dev/null and b/themes/bgrt/animation-0006.png differ diff --git a/themes/bgrt/animation-0007.png b/themes/bgrt/animation-0007.png new file mode 100644 index 00000000..d2ccac92 Binary files /dev/null and b/themes/bgrt/animation-0007.png differ diff --git a/themes/bgrt/animation-0008.png b/themes/bgrt/animation-0008.png new file mode 100644 index 00000000..85849c8f Binary files /dev/null and b/themes/bgrt/animation-0008.png differ diff --git a/themes/bgrt/animation-0009.png b/themes/bgrt/animation-0009.png new file mode 100644 index 00000000..3e79b9bc Binary files /dev/null and b/themes/bgrt/animation-0009.png differ diff --git a/themes/bgrt/animation-0010.png b/themes/bgrt/animation-0010.png new file mode 100644 index 00000000..1f64875a Binary files /dev/null and b/themes/bgrt/animation-0010.png differ diff --git a/themes/bgrt/animation-0011.png b/themes/bgrt/animation-0011.png new file mode 100644 index 00000000..57bec05f Binary files /dev/null and b/themes/bgrt/animation-0011.png differ diff --git a/themes/bgrt/animation-0012.png b/themes/bgrt/animation-0012.png new file mode 100644 index 00000000..cdefdc78 Binary files /dev/null and b/themes/bgrt/animation-0012.png differ diff --git a/themes/bgrt/animation-0013.png b/themes/bgrt/animation-0013.png new file mode 100644 index 00000000..de5aa6ec Binary files /dev/null and b/themes/bgrt/animation-0013.png differ diff --git a/themes/bgrt/animation-0014.png b/themes/bgrt/animation-0014.png new file mode 100644 index 00000000..a0199041 Binary files /dev/null and b/themes/bgrt/animation-0014.png differ diff --git a/themes/bgrt/animation-0015.png b/themes/bgrt/animation-0015.png new file mode 100644 index 00000000..249e1739 Binary files /dev/null and b/themes/bgrt/animation-0015.png differ diff --git a/themes/bgrt/animation-0016.png b/themes/bgrt/animation-0016.png new file mode 100644 index 00000000..f72a577c Binary files /dev/null and b/themes/bgrt/animation-0016.png differ diff --git a/themes/bgrt/animation-0017.png b/themes/bgrt/animation-0017.png new file mode 100644 index 00000000..02926e71 Binary files /dev/null and b/themes/bgrt/animation-0017.png differ diff --git a/themes/bgrt/animation-0018.png b/themes/bgrt/animation-0018.png new file mode 100644 index 00000000..667cd7d4 Binary files /dev/null and b/themes/bgrt/animation-0018.png differ diff --git a/themes/bgrt/animation-0019.png b/themes/bgrt/animation-0019.png new file mode 100644 index 00000000..760868a0 Binary files /dev/null and b/themes/bgrt/animation-0019.png differ diff --git a/themes/bgrt/animation-0020.png b/themes/bgrt/animation-0020.png new file mode 100644 index 00000000..d228ed84 Binary files /dev/null and b/themes/bgrt/animation-0020.png differ diff --git a/themes/bgrt/animation-0021.png b/themes/bgrt/animation-0021.png new file mode 100644 index 00000000..e7bd0f5c Binary files /dev/null and b/themes/bgrt/animation-0021.png differ diff --git a/themes/bgrt/animation-0022.png b/themes/bgrt/animation-0022.png new file mode 100644 index 00000000..4c772822 Binary files /dev/null and b/themes/bgrt/animation-0022.png differ diff --git a/themes/bgrt/animation-0023.png b/themes/bgrt/animation-0023.png new file mode 100644 index 00000000..8e77aa14 Binary files /dev/null and b/themes/bgrt/animation-0023.png differ diff --git a/themes/bgrt/animation-0024.png b/themes/bgrt/animation-0024.png new file mode 100644 index 00000000..ed52d3d4 Binary files /dev/null and b/themes/bgrt/animation-0024.png differ diff --git a/themes/bgrt/animation-0025.png b/themes/bgrt/animation-0025.png new file mode 100644 index 00000000..371a299f Binary files /dev/null and b/themes/bgrt/animation-0025.png differ diff --git a/themes/bgrt/animation-0026.png b/themes/bgrt/animation-0026.png new file mode 100644 index 00000000..1bfd5dca Binary files /dev/null and b/themes/bgrt/animation-0026.png differ diff --git a/themes/bgrt/animation-0027.png b/themes/bgrt/animation-0027.png new file mode 100644 index 00000000..6f4d83b6 Binary files /dev/null and b/themes/bgrt/animation-0027.png differ diff --git a/themes/bgrt/animation-0028.png b/themes/bgrt/animation-0028.png new file mode 100644 index 00000000..eda5e3f2 Binary files /dev/null and b/themes/bgrt/animation-0028.png differ diff --git a/themes/bgrt/animation-0029.png b/themes/bgrt/animation-0029.png new file mode 100644 index 00000000..33f26830 Binary files /dev/null and b/themes/bgrt/animation-0029.png differ diff --git a/themes/bgrt/animation-0030.png b/themes/bgrt/animation-0030.png new file mode 100644 index 00000000..c5132bd9 Binary files /dev/null and b/themes/bgrt/animation-0030.png differ diff --git a/themes/bgrt/animation-0031.png b/themes/bgrt/animation-0031.png new file mode 100644 index 00000000..f6ed4b2b Binary files /dev/null and b/themes/bgrt/animation-0031.png differ diff --git a/themes/bgrt/animation-0032.png b/themes/bgrt/animation-0032.png new file mode 100644 index 00000000..09791642 Binary files /dev/null and b/themes/bgrt/animation-0032.png differ diff --git a/themes/bgrt/animation-0033.png b/themes/bgrt/animation-0033.png new file mode 100644 index 00000000..c9ec0e5e Binary files /dev/null and b/themes/bgrt/animation-0033.png differ diff --git a/themes/bgrt/animation-0034.png b/themes/bgrt/animation-0034.png new file mode 100644 index 00000000..2851ef3b Binary files /dev/null and b/themes/bgrt/animation-0034.png differ diff --git a/themes/bgrt/animation-0035.png b/themes/bgrt/animation-0035.png new file mode 100644 index 00000000..2bd3b0dc Binary files /dev/null and b/themes/bgrt/animation-0035.png differ diff --git a/themes/bgrt/animation-0036.png b/themes/bgrt/animation-0036.png new file mode 100644 index 00000000..fbe48ff5 Binary files /dev/null and b/themes/bgrt/animation-0036.png differ diff --git a/themes/bgrt/background-tile.png b/themes/bgrt/background-tile.png new file mode 100644 index 00000000..6b70a2d4 Binary files /dev/null and b/themes/bgrt/background-tile.png differ diff --git a/themes/bgrt/bgrt.plymouth.in b/themes/bgrt/bgrt.plymouth.in new file mode 100644 index 00000000..b5cc8432 --- /dev/null +++ b/themes/bgrt/bgrt.plymouth.in @@ -0,0 +1,16 @@ +[Plymouth Theme] +Name=BGRT +Description=Jimmac's spinner theme using the ACPI BGRT graphics as background +ModuleName=two-step + +[two-step] +ImageDir=@PLYMOUTH_THEME_PATH@/bgrt +HorizontalAlignment=.5 +VerticalAlignment=.75 +WatermarkHorizontalAlignment=.5 +WatermarkVerticalAlignment=.96 +Transition=none +TransitionDuration=0.0 +BackgroundStartColor=0x202020 +BackgroundEndColor=0x202020 +UseBGRT=true diff --git a/themes/bgrt/box.png b/themes/bgrt/box.png new file mode 100644 index 00000000..54876e68 Binary files /dev/null and b/themes/bgrt/box.png differ diff --git a/themes/bgrt/bullet.png b/themes/bgrt/bullet.png new file mode 100644 index 00000000..87ddfe81 Binary files /dev/null and b/themes/bgrt/bullet.png differ diff --git a/themes/bgrt/entry.png b/themes/bgrt/entry.png new file mode 100644 index 00000000..65810dea Binary files /dev/null and b/themes/bgrt/entry.png differ diff --git a/themes/bgrt/lock.png b/themes/bgrt/lock.png new file mode 100644 index 00000000..f2330495 Binary files /dev/null and b/themes/bgrt/lock.png differ diff --git a/themes/bgrt/throbber-0001.png b/themes/bgrt/throbber-0001.png new file mode 100644 index 00000000..6a64683c Binary files /dev/null and b/themes/bgrt/throbber-0001.png differ diff --git a/themes/bgrt/throbber-0002.png b/themes/bgrt/throbber-0002.png new file mode 100644 index 00000000..8e9a85d8 Binary files /dev/null and b/themes/bgrt/throbber-0002.png differ diff --git a/themes/bgrt/throbber-0003.png b/themes/bgrt/throbber-0003.png new file mode 100644 index 00000000..9fe95aa2 Binary files /dev/null and b/themes/bgrt/throbber-0003.png differ diff --git a/themes/bgrt/throbber-0004.png b/themes/bgrt/throbber-0004.png new file mode 100644 index 00000000..687aa8bb Binary files /dev/null and b/themes/bgrt/throbber-0004.png differ diff --git a/themes/bgrt/throbber-0005.png b/themes/bgrt/throbber-0005.png new file mode 100644 index 00000000..3a56beb7 Binary files /dev/null and b/themes/bgrt/throbber-0005.png differ diff --git a/themes/bgrt/throbber-0006.png b/themes/bgrt/throbber-0006.png new file mode 100644 index 00000000..949cb230 Binary files /dev/null and b/themes/bgrt/throbber-0006.png differ diff --git a/themes/bgrt/throbber-0007.png b/themes/bgrt/throbber-0007.png new file mode 100644 index 00000000..14d8b45c Binary files /dev/null and b/themes/bgrt/throbber-0007.png differ diff --git a/themes/bgrt/throbber-0008.png b/themes/bgrt/throbber-0008.png new file mode 100644 index 00000000..beef3913 Binary files /dev/null and b/themes/bgrt/throbber-0008.png differ diff --git a/themes/bgrt/throbber-0009.png b/themes/bgrt/throbber-0009.png new file mode 100644 index 00000000..b366daa8 Binary files /dev/null and b/themes/bgrt/throbber-0009.png differ diff --git a/themes/bgrt/throbber-0010.png b/themes/bgrt/throbber-0010.png new file mode 100644 index 00000000..0312f626 Binary files /dev/null and b/themes/bgrt/throbber-0010.png differ diff --git a/themes/bgrt/throbber-0011.png b/themes/bgrt/throbber-0011.png new file mode 100644 index 00000000..f3e2cb9e Binary files /dev/null and b/themes/bgrt/throbber-0011.png differ diff --git a/themes/bgrt/throbber-0012.png b/themes/bgrt/throbber-0012.png new file mode 100644 index 00000000..ca4f0172 Binary files /dev/null and b/themes/bgrt/throbber-0012.png differ diff --git a/themes/bgrt/throbber-0013.png b/themes/bgrt/throbber-0013.png new file mode 100644 index 00000000..ace87648 Binary files /dev/null and b/themes/bgrt/throbber-0013.png differ diff --git a/themes/bgrt/throbber-0014.png b/themes/bgrt/throbber-0014.png new file mode 100644 index 00000000..6c43a9d5 Binary files /dev/null and b/themes/bgrt/throbber-0014.png differ diff --git a/themes/bgrt/throbber-0015.png b/themes/bgrt/throbber-0015.png new file mode 100644 index 00000000..1e87c5d2 Binary files /dev/null and b/themes/bgrt/throbber-0015.png differ diff --git a/themes/bgrt/throbber-0016.png b/themes/bgrt/throbber-0016.png new file mode 100644 index 00000000..fac163b6 Binary files /dev/null and b/themes/bgrt/throbber-0016.png differ diff --git a/themes/bgrt/throbber-0017.png b/themes/bgrt/throbber-0017.png new file mode 100644 index 00000000..ce792def Binary files /dev/null and b/themes/bgrt/throbber-0017.png differ diff --git a/themes/bgrt/throbber-0018.png b/themes/bgrt/throbber-0018.png new file mode 100644 index 00000000..6423b951 Binary files /dev/null and b/themes/bgrt/throbber-0018.png differ diff --git a/themes/bgrt/throbber-0019.png b/themes/bgrt/throbber-0019.png new file mode 100644 index 00000000..45e93592 Binary files /dev/null and b/themes/bgrt/throbber-0019.png differ diff --git a/themes/bgrt/throbber-0020.png b/themes/bgrt/throbber-0020.png new file mode 100644 index 00000000..b84b04dd Binary files /dev/null and b/themes/bgrt/throbber-0020.png differ diff --git a/themes/bgrt/throbber-0021.png b/themes/bgrt/throbber-0021.png new file mode 100644 index 00000000..a64932df Binary files /dev/null and b/themes/bgrt/throbber-0021.png differ diff --git a/themes/bgrt/throbber-0022.png b/themes/bgrt/throbber-0022.png new file mode 100644 index 00000000..4b57e234 Binary files /dev/null and b/themes/bgrt/throbber-0022.png differ diff --git a/themes/bgrt/throbber-0023.png b/themes/bgrt/throbber-0023.png new file mode 100644 index 00000000..b3dbeef0 Binary files /dev/null and b/themes/bgrt/throbber-0023.png differ diff --git a/themes/bgrt/throbber-0024.png b/themes/bgrt/throbber-0024.png new file mode 100644 index 00000000..196e987d Binary files /dev/null and b/themes/bgrt/throbber-0024.png differ diff --git a/themes/bgrt/throbber-0025.png b/themes/bgrt/throbber-0025.png new file mode 100644 index 00000000..3905e00e Binary files /dev/null and b/themes/bgrt/throbber-0025.png differ diff --git a/themes/bgrt/throbber-0026.png b/themes/bgrt/throbber-0026.png new file mode 100644 index 00000000..4c02eb16 Binary files /dev/null and b/themes/bgrt/throbber-0026.png differ diff --git a/themes/bgrt/throbber-0027.png b/themes/bgrt/throbber-0027.png new file mode 100644 index 00000000..9ab5b001 Binary files /dev/null and b/themes/bgrt/throbber-0027.png differ diff --git a/themes/bgrt/throbber-0028.png b/themes/bgrt/throbber-0028.png new file mode 100644 index 00000000..fa8584b3 Binary files /dev/null and b/themes/bgrt/throbber-0028.png differ diff --git a/themes/bgrt/throbber-0029.png b/themes/bgrt/throbber-0029.png new file mode 100644 index 00000000..d9931e1e Binary files /dev/null and b/themes/bgrt/throbber-0029.png differ diff --git a/themes/bgrt/throbber-0030.png b/themes/bgrt/throbber-0030.png new file mode 100644 index 00000000..fc1683f8 Binary files /dev/null and b/themes/bgrt/throbber-0030.png differ -- cgit v1.2.3