summaryrefslogtreecommitdiff
path: root/gdk/gdktexture.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-09-21 23:08:09 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-09-21 23:10:53 -0400
commit0b9f6985b1a255fc044e1eb279c19ff62406eb0b (patch)
treed4be19a6601c3e694859f4e650f96c8efee8ddb1 /gdk/gdktexture.c
parent1430142ad8d6af5151410751761caf5981fde2f8 (diff)
downloadgtk+-0b9f6985b1a255fc044e1eb279c19ff62406eb0b.tar.gz
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.
Diffstat (limited to 'gdk/gdktexture.c')
-rw-r--r--gdk/gdktexture.c20
1 files changed, 20 insertions, 0 deletions
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 *