[retro-gtk] retro-pixdata: Use retro_pixbuf_set_aspect_ratio()



commit bef8b62ef67668e6d869ff499590f3e60333033d
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Wed Aug 14 15:49:42 2019 +0500

    retro-pixdata: Use retro_pixbuf_set_aspect_ratio()
    
    Deprecate x-dpi and y-dpi in favor of the newly added functions.

 retro-gtk/retro-pixdata.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/retro-gtk/retro-pixdata.c b/retro-gtk/retro-pixdata.c
index 4f2633b..b2208d8 100644
--- a/retro-gtk/retro-pixdata.c
+++ b/retro-gtk/retro-pixdata.c
@@ -3,6 +3,7 @@
 #include "retro-pixdata-private.h"
 
 #include <epoxy/gl.h>
+#include "retro-pixbuf.h"
 
 G_DEFINE_BOXED_TYPE (RetroPixdata, retro_pixdata, retro_pixdata_copy, retro_pixdata_free)
 
@@ -343,12 +344,16 @@ retro_pixdata_to_pixbuf (RetroPixdata *self)
                                      self->width * sizeof (rgba8888),
                                      pixels_free, NULL);
 
+  /* x-dpi and y-dpi are deprecated, retro_pixbuf_get_aspect_ratio() and
+   * retro_pixbuf_set_aspect_ratio() should be used instead. */
   x_dpi = self->aspect_ratio * RETRO_CAIRO_DISPLAY_Y_DPI;
   x_dpi_string = g_strdup_printf ("%g", x_dpi);
   y_dpi_string = g_strdup_printf ("%g", RETRO_CAIRO_DISPLAY_Y_DPI);
   gdk_pixbuf_set_option (pixbuf, "x-dpi", x_dpi_string);
   gdk_pixbuf_set_option (pixbuf, "y-dpi", y_dpi_string);
 
+  retro_pixbuf_set_aspect_ratio (pixbuf, self->aspect_ratio);
+
   return pixbuf;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]