]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-pixel-display: Add ply_pixel_display_get_device_scale() function
authorHans de Goede <hdegoede@redhat.com>
Wed, 7 Nov 2018 14:46:06 +0000 (15:46 +0100)
committerHans de Goede <hdegoede@redhat.com>
Tue, 27 Nov 2018 07:48:56 +0000 (08:48 +0100)
Add a function to get the device scale for a ply-pixel-display.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/libply-splash-core/ply-pixel-display.c
src/libply-splash-core/ply-pixel-display.h

index cb01a2c691a685673df201dd7eab9b8a15b735b1..dc088bb69548182f9889aee35950a68936408ee2 100644 (file)
@@ -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)
 {
index 675c181d2783a68ee5f5e5932ec0b9eb3d3d6dcc..a57b9a9ad1612c9cc47fffde50130f091fabfdbd 100644 (file)
@@ -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,