From 69dff6a324c21598025dedd3b5d08e81edf5fa3f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 2 Jan 2025 16:04:41 -0500 Subject: [PATCH 1/4] Drop a use of gdk_texture_new_from_pixbuf gdk_memory_texture_new works just as well here. Part-of: --- testsuite/gdk/cursor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/testsuite/gdk/cursor.c b/testsuite/gdk/cursor.c index e9c42671e9d..15e83c7a634 100644 --- a/testsuite/gdk/cursor.c +++ b/testsuite/gdk/cursor.c @@ -20,12 +20,13 @@ test_cursor_named (void) static void test_cursor_texture (void) { - GdkPixbuf *pixbuf; + GBytes *bytes; GdkTexture *texture; GdkCursor *cursor; - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 32, 32); - texture = gdk_texture_new_for_pixbuf (pixbuf); + bytes = g_bytes_new_take (g_malloc (32 * 32 * 4), 32 * 32 * 4); + texture = gdk_memory_texture_new (32, 32, GDK_MEMORY_DEFAULT, bytes, 32 * 4); + cursor = gdk_cursor_new_from_texture (texture, 1, 2, NULL); g_assert_null (gdk_cursor_get_name (cursor)); @@ -36,7 +37,7 @@ test_cursor_texture (void) g_object_unref (cursor); g_object_unref (texture); - g_object_unref (pixbuf); + g_bytes_unref (bytes); } static void -- GitLab From 8afc0be3f1169e7746562aa1316bce26328df919 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 2 Jan 2025 14:49:22 -0500 Subject: [PATCH 2/4] Deprecate gdk_texture_new_for_pixbuf This is a simple wrapper around gdk_memory_texture_new(). Alternatively, libglycin offers a better alternative to load many image formats into a GdkTexture. Part-of: --- demos/gtk-demo/cursors.c | 2 ++ demos/gtk-demo/fontrendering.c | 2 ++ demos/gtk-demo/images.c | 4 ++++ demos/gtk-demo/pixbufpaintable.c | 2 +- demos/widget-factory/widget-factory.c | 4 ++++ gdk/gdkcairo.c | 2 ++ gdk/gdkcontentdeserializer.c | 2 ++ gdk/gdktexture.c | 5 +++++ gdk/gdktexture.h | 2 +- gtk/gdktextureutils.c | 16 ++++++++++++++++ gtk/gtkicontheme.c | 2 ++ gtk/gtkimage.c | 2 ++ gtk/gtkmountoperation-x11.c | 2 ++ gtk/gtkpicture.c | 4 ++++ tests/callbackcursor.c | 2 ++ testsuite/gdk/memorytexture.c | 4 ++++ testsuite/gdk/texture.c | 6 ++++++ 17 files changed, 61 insertions(+), 2 deletions(-) diff --git a/demos/gtk-demo/cursors.c b/demos/gtk-demo/cursors.c index 4a91ce5b7f7..b077574c5a7 100644 --- a/demos/gtk-demo/cursors.c +++ b/demos/gtk-demo/cursors.c @@ -43,7 +43,9 @@ cursor_callback (GdkCursor *cursor, return NULL; } +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); diff --git a/demos/gtk-demo/fontrendering.c b/demos/gtk-demo/fontrendering.c index e8ecd71d2df..963637dea4e 100644 --- a/demos/gtk-demo/fontrendering.c +++ b/demos/gtk-demo/fontrendering.c @@ -303,7 +303,9 @@ retry: cairo_surface_destroy (surface); } +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf2); +G_GNUC_END_IGNORE_DEPRECATIONS gtk_picture_set_paintable (GTK_PICTURE (image), GDK_PAINTABLE (texture)); g_object_unref (pixbuf2); g_object_unref (texture); diff --git a/demos/gtk-demo/images.c b/demos/gtk-demo/images.c index 08fcf1dc58d..19397824b7a 100644 --- a/demos/gtk-demo/images.c +++ b/demos/gtk-demo/images.c @@ -41,7 +41,9 @@ progressive_prepared_callback (GdkPixbufLoader *loader, */ gdk_pixbuf_fill (pixbuf, 0xaaaaaaff); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS gtk_picture_set_paintable (GTK_PICTURE (picture), GDK_PAINTABLE (texture)); g_object_unref (texture); } @@ -57,7 +59,9 @@ progressive_updated_callback (GdkPixbufLoader *loader, GtkWidget *picture = GTK_WIDGET (data); GdkTexture *texture; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (gdk_pixbuf_loader_get_pixbuf (loader)); +G_GNUC_END_IGNORE_DEPRECATIONS gtk_picture_set_paintable (GTK_PICTURE (picture), GDK_PAINTABLE (texture)); g_object_unref (texture); } diff --git a/demos/gtk-demo/pixbufpaintable.c b/demos/gtk-demo/pixbufpaintable.c index d7193182d70..74e6c798356 100644 --- a/demos/gtk-demo/pixbufpaintable.c +++ b/demos/gtk-demo/pixbufpaintable.c @@ -30,9 +30,9 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_get_current_time (&val); gdk_pixbuf_animation_iter_advance (self->iter, &val); -G_GNUC_END_IGNORE_DEPRECATIONS pixbuf = gdk_pixbuf_animation_iter_get_pixbuf (self->iter); texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS gdk_paintable_snapshot (GDK_PAINTABLE (texture), snapshot, width, height); diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 70ba13a8740..48181778777 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -1236,7 +1236,9 @@ background_loaded_cb (GObject *source, return; } +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS add_background (bd->flowbox, bd->filename, texture, FALSE); g_object_unref (texture); @@ -1286,7 +1288,9 @@ populate_flowbox (GtkWidget *flowbox) { filename = g_strconcat ("/org/gtk/WidgetFactory4/", resources[i], NULL); pixbuf = gdk_pixbuf_new_from_resource_at_scale (filename, 110, 110, TRUE, NULL); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS add_background (flowbox, filename, texture, TRUE); g_object_unref (texture); g_object_unref (pixbuf); diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c index 0f30f263a25..ba68a21b8d6 100644 --- a/gdk/gdkcairo.c +++ b/gdk/gdkcairo.c @@ -110,7 +110,9 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface, cairo_surface_flush (surface); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (GDK_PIXBUF (pixbuf)); +G_GNUC_END_IGNORE_DEPRECATIONS gdk_texture_download (texture, cairo_image_surface_get_data (surface), cairo_image_surface_get_stride (surface)); diff --git a/gdk/gdkcontentdeserializer.c b/gdk/gdkcontentdeserializer.c index e367c938c4d..40b6060a538 100644 --- a/gdk/gdkcontentdeserializer.c +++ b/gdk/gdkcontentdeserializer.c @@ -640,7 +640,9 @@ pixbuf_deserializer_finish (GObject *source, else if (G_VALUE_HOLDS (value, GDK_TYPE_TEXTURE)) { GdkTexture *texture; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); g_value_take_object (value, texture); } diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c index 48ef5372219..7795dc689b9 100644 --- a/gdk/gdktexture.c +++ b/gdk/gdktexture.c @@ -530,6 +530,9 @@ gdk_texture_new_for_surface (cairo_surface_t *surface) * while loading a big image. * * Returns: a new `GdkTexture` + * + * Deprecated: 4.20: Use e.g. libglycin, which can load many image + * formats into GdkTexture */ GdkTexture * gdk_texture_new_for_pixbuf (GdkPixbuf *pixbuf) @@ -687,7 +690,9 @@ gdk_texture_new_from_bytes_pixbuf (GBytes *bytes, if (pixbuf == NULL) return NULL; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); return texture; diff --git a/gdk/gdktexture.h b/gdk/gdktexture.h index a9321191488..31ce7ec3fdb 100644 --- a/gdk/gdktexture.h +++ b/gdk/gdktexture.h @@ -62,7 +62,7 @@ typedef enum GDK_AVAILABLE_IN_ALL GType gdk_texture_get_type (void) G_GNUC_CONST; -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_20 GdkTexture * gdk_texture_new_for_pixbuf (GdkPixbuf *pixbuf); GDK_AVAILABLE_IN_ALL GdkTexture * gdk_texture_new_from_resource (const char *resource_path); diff --git a/gtk/gdktextureutils.c b/gtk/gdktextureutils.c index 026ee9e2783..dc40205cf54 100644 --- a/gtk/gdktextureutils.c +++ b/gtk/gdktextureutils.c @@ -636,7 +636,9 @@ gdk_texture_new_from_stream_with_fg (GInputStream *stream, if (pixbuf) { *only_fg = pixbuf_is_only_fg (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); } @@ -659,7 +661,9 @@ gdk_texture_new_from_stream_at_scale (GInputStream *stream, if (pixbuf) { *only_fg = pixbuf_is_only_fg (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); } @@ -681,7 +685,9 @@ gdk_texture_new_from_resource_at_scale (const char *path, if (pixbuf) { *only_fg = pixbuf_is_only_fg (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); } @@ -706,7 +712,9 @@ gdk_texture_new_from_filename_symbolic (const char *filename, if (pixbuf) { *only_fg = pixbuf_is_only_fg (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); } @@ -734,7 +742,9 @@ gdk_texture_new_from_resource_symbolic (const char *path, if (pixbuf) { *only_fg = pixbuf_is_only_fg (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); } @@ -757,7 +767,9 @@ gtk_load_symbolic_texture_from_file (GFile *file) if (pixbuf == NULL) return NULL; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); return texture; @@ -778,7 +790,9 @@ gdk_texture_new_from_file_symbolic (GFile *file, if (pixbuf) { *only_fg = pixbuf_is_only_fg (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); } @@ -849,7 +863,9 @@ gdk_paintable_new_from_bytes_scaled (GBytes *bytes, if (!success) return NULL; +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (gdk_pixbuf_loader_get_pixbuf (loader)); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (loader); if (loader_data.scale != 1.0) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 2b54c6f7403..d920ea6612d 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -4080,7 +4080,9 @@ gtk_icon_theme_lookup_by_gicon (GtkIconTheme *self, else if (GDK_IS_PIXBUF (gicon)) { paintable = icon_paintable_new (NULL, size, scale); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS paintable->texture = gdk_texture_new_for_pixbuf (GDK_PIXBUF (gicon)); +G_GNUC_END_IGNORE_DEPRECATIONS } else if (G_IS_FILE_ICON (gicon)) { diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index 4306d2e3397..8ad18e420bd 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -731,10 +731,12 @@ gtk_image_set_from_pixbuf (GtkImage *image, g_return_if_fail (GTK_IS_IMAGE (image)); g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf)); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (pixbuf) texture = gdk_texture_new_for_pixbuf (pixbuf); else texture = NULL; +G_GNUC_END_IGNORE_DEPRECATIONS gtk_image_set_from_paintable (image, GDK_PAINTABLE (texture)); diff --git a/gtk/gtkmountoperation-x11.c b/gtk/gtkmountoperation-x11.c index 22cea2acfb6..41db0f56302 100644 --- a/gtk/gtkmountoperation-x11.c +++ b/gtk/gtkmountoperation-x11.c @@ -462,7 +462,9 @@ scaled_from_pixdata (guchar *pixdata, dest = src; } +G_GNUC_BEGIN_IGNORE_DEPRECATIONS ret = gdk_texture_new_for_pixbuf (dest); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (dest); diff --git a/gtk/gtkpicture.c b/gtk/gtkpicture.c index 350e7200637..32e24be9f44 100644 --- a/gtk/gtkpicture.c +++ b/gtk/gtkpicture.c @@ -556,10 +556,12 @@ gtk_picture_new_for_pixbuf (GdkPixbuf *pixbuf) g_return_val_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf), NULL); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (pixbuf) paintable = GDK_PAINTABLE (gdk_texture_new_for_pixbuf (pixbuf)); else paintable = NULL; +G_GNUC_END_IGNORE_DEPRECATIONS result = gtk_picture_new_for_paintable (paintable); @@ -813,10 +815,12 @@ gtk_picture_set_pixbuf (GtkPicture *self, g_return_if_fail (GTK_IS_PICTURE (self)); g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf)); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (pixbuf) texture = gdk_texture_new_for_pixbuf (pixbuf); else texture = NULL; +G_GNUC_END_IGNORE_DEPRECATIONS gtk_picture_set_paintable (self, GDK_PAINTABLE (texture)); diff --git a/tests/callbackcursor.c b/tests/callbackcursor.c index 63c651fde20..d682c2f0b40 100644 --- a/tests/callbackcursor.c +++ b/tests/callbackcursor.c @@ -48,7 +48,9 @@ cursor_callback (GdkCursor *cursor, return NULL; } +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (pixbuf); diff --git a/testsuite/gdk/memorytexture.c b/testsuite/gdk/memorytexture.c index 14b206c9943..e0d63c6687f 100644 --- a/testsuite/gdk/memorytexture.c +++ b/testsuite/gdk/memorytexture.c @@ -270,7 +270,9 @@ create_texture (GdkMemoryFormat format, pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, NULL); g_object_unref (stream); g_assert_nonnull (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_assert_nonnull (texture); g_object_unref (pixbuf); g_bytes_unref (bytes); @@ -301,7 +303,9 @@ create_texture (GdkMemoryFormat format, pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, NULL); g_object_unref (stream); g_assert_nonnull (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_assert_nonnull (texture); g_object_unref (pixbuf); g_bytes_unref (bytes); diff --git a/testsuite/gdk/texture.c b/testsuite/gdk/texture.c index 488b151130b..f19d73a8ee9 100644 --- a/testsuite/gdk/texture.c +++ b/testsuite/gdk/texture.c @@ -113,7 +113,9 @@ test_texture_from_pixbuf (void) width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS g_assert_nonnull (texture); g_assert_cmpint (gdk_texture_get_width (texture), ==, width); @@ -283,7 +285,9 @@ test_texture_icon (void) g_assert_no_error (error); g_assert_nonnull (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture2 = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS compare_textures (texture, texture2); @@ -313,7 +317,9 @@ icon_loaded (GObject *source, g_assert_no_error (error); g_assert_nonnull (pixbuf); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS texture2 = gdk_texture_new_for_pixbuf (pixbuf); +G_GNUC_END_IGNORE_DEPRECATIONS compare_textures (texture, texture2); -- GitLab From 6d18bd9958fe0647ed6bc9e7d1b86c03afb4009f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 2 Jan 2025 14:53:32 -0500 Subject: [PATCH 3/4] Deprecate gdk_cairo_set_source_pixbuf We don't have a direct 1-1 replacement, but we want to get rid of both cairo and gdk-pixbuf in the future, so make our intentions clear. Part-of: --- gdk/gdkcairo.c | 2 ++ gdk/gdkcairo.h | 2 +- testsuite/gdk/cairo.c | 2 ++ testsuite/gdk/texture.c | 2 ++ testsuite/gtk/no-gtk-init.c | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c index ba68a21b8d6..cebeb196f46 100644 --- a/gdk/gdkcairo.c +++ b/gdk/gdkcairo.c @@ -132,6 +132,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS * * The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned * so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y. + * + * Deprecated: 4.20: Use cairo_set_source_surface() and gdk_texture_download() */ void gdk_cairo_set_source_pixbuf (cairo_t *cr, diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h index eafc4c29dc1..6dc9586adae 100644 --- a/gdk/gdkcairo.h +++ b/gdk/gdkcairo.h @@ -30,7 +30,7 @@ G_BEGIN_DECLS GDK_AVAILABLE_IN_ALL void gdk_cairo_set_source_rgba (cairo_t *cr, const GdkRGBA *rgba); -GDK_AVAILABLE_IN_ALL +GDK_DEPRECATED_IN_4_20 void gdk_cairo_set_source_pixbuf (cairo_t *cr, const GdkPixbuf *pixbuf, double pixbuf_x, diff --git a/testsuite/gdk/cairo.c b/testsuite/gdk/cairo.c index 9f8f172411d..b8c1491c7ed 100644 --- a/testsuite/gdk/cairo.c +++ b/testsuite/gdk/cairo.c @@ -20,7 +20,9 @@ test_set_source_big_pixbuf (void) cr = cairo_create (surface); pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, WAY_TOO_BIG, 1); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); +G_GNUC_END_IGNORE_DEPRECATIONS g_assert_cmpint (cairo_status (cr), !=, CAIRO_STATUS_SUCCESS); g_object_unref (pixbuf); diff --git a/testsuite/gdk/texture.c b/testsuite/gdk/texture.c index f19d73a8ee9..b80876ea00f 100644 --- a/testsuite/gdk/texture.c +++ b/testsuite/gdk/texture.c @@ -127,7 +127,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cr = cairo_create (surface); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); +G_GNUC_END_IGNORE_DEPRECATIONS cairo_paint (cr); cairo_destroy (cr); diff --git a/testsuite/gtk/no-gtk-init.c b/testsuite/gtk/no-gtk-init.c index 06f1b6772a4..48f9a82c074 100644 --- a/testsuite/gtk/no-gtk-init.c +++ b/testsuite/gtk/no-gtk-init.c @@ -33,7 +33,9 @@ test_gdk_cairo_set_source_pixbuf (void) surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 10, 10); cr = cairo_create (surface); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); +G_GNUC_END_IGNORE_DEPRECATIONS cairo_paint (cr); cairo_destroy (cr); -- GitLab From 47c2ac73b1e4d93481e836e0c9a9da0e058ef8d1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 3 May 2025 16:58:36 -0400 Subject: [PATCH 4/4] texture: Update some docs Replace references to gdk-pixbuf with libglycin. Part-of: --- gdk/gdktexture.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c index 7795dc689b9..fd194adc032 100644 --- a/gdk/gdktexture.c +++ b/gdk/gdktexture.c @@ -526,8 +526,8 @@ gdk_texture_new_for_surface (cairo_surface_t *surface) * Creates a new texture object representing the `GdkPixbuf`. * * This function is threadsafe, so that you can e.g. use GTask - * and [method@Gio.Task.run_in_thread] to avoid blocking the main thread - * while loading a big image. + * and [method@Gio.Task.run_in_thread] to avoid blocking the main + * thread while loading a big image. * * Returns: a new `GdkTexture` * @@ -1147,9 +1147,9 @@ gdk_texture_get_render_data (GdkTexture *self, * * This is a utility function intended for debugging and testing. * If you want more control over formats, proper error handling or - * want to store to a [iface@Gio.File] or other location, you might want to - * use [method@Gdk.Texture.save_to_png_bytes] or look into the - * gdk-pixbuf library. + * want to store to a [iface@Gio.File] or other location, you might + * want to use [method@Gdk.Texture.save_to_png_bytes] or look into + * the libglycin library. * * Returns: %TRUE if saving succeeded, %FALSE on failure. */ @@ -1186,7 +1186,7 @@ gdk_texture_save_to_png (GdkTexture *texture, * * If you need more control over the generated image, such as * attaching metadata, you should look into an image handling - * library such as the gdk-pixbuf library. + * library such as the libglycin library. * * If you are dealing with high dynamic range float data, you * might also want to consider [method@Gdk.Texture.save_to_tiff_bytes] -- GitLab