From: Matthias Clasen Date: Wed, 22 Sep 2021 03:08:09 +0000 (-0400) Subject: texture: Document constructors as threadsafe X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~5^2~317^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0b9f6985b1a255fc044e1eb279c19ff62406eb0b;p=gtk4.git texture: Document constructors as threadsafe We aren't providing async loading apis here, but we want to allow applications to create textures in a thread, to avoid blocking the main thread. --- diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c index 3f602cc5cc..e04adfbb33 100644 --- a/gdk/gdktexture.c +++ b/gdk/gdktexture.c @@ -409,6 +409,10 @@ 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 g_task_run_in_thread() to avoid blocking the main thread + * while loading a big image. + * * Returns: a new `GdkTexture` */ GdkTexture * @@ -451,6 +455,10 @@ gdk_texture_new_for_pixbuf (GdkPixbuf *pixbuf) * If you are unsure about the validity of a resource, use * [ctor@Gdk.Texture.new_from_file] to load it. * + * This function is threadsafe, so that you can e.g. use GTask + * and g_task_run_in_thread() to avoid blocking the main thread + * while loading a big image. + * * Return value: A newly-created `GdkTexture` */ GdkTexture * @@ -489,6 +497,10 @@ gdk_texture_new_from_resource (const char *resource_path) * * If %NULL is returned, then @error will be set. * + * This function is threadsafe, so that you can e.g. use GTask + * and g_task_run_in_thread() to avoid blocking the main thread + * while loading a big image. + * * Return value: A newly-created `GdkTexture` */ GdkTexture * @@ -578,6 +590,10 @@ gdk_texture_new_from_bytes_pixbuf (GBytes *bytes, * * If %NULL is returned, then @error will be set. * + * This function is threadsafe, so that you can e.g. use GTask + * and g_task_run_in_thread() to avoid blocking the main thread + * while loading a big image. + * * Return value: A newly-created `GdkTexture` * * Since: 4.6 @@ -620,6 +636,10 @@ gdk_texture_new_from_bytes (GBytes *bytes, * * If %NULL is returned, then @error will be set. * + * This function is threadsafe, so that you can e.g. use GTask + * and g_task_run_in_thread() to avoid blocking the main thread + * while loading a big image. + * * Return value: A newly-created `GdkTexture` */ GdkTexture *