mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 18:30:08 +00:00
gdk: Add function to query alpha format for depth
It's meant to be used in renderers.
This commit is contained in:
parent
4a8122f685
commit
b1b8a98568
@ -704,6 +704,33 @@ gdk_memory_depth_merge (GdkMemoryDepth depth1,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gdk_memory_depth_get_alpha_format:
|
||||
* @depth: the depth
|
||||
*
|
||||
* Gets the preferred format to use for rendering masks and other
|
||||
* alpha-only content.
|
||||
*
|
||||
* Returns: the format
|
||||
**/
|
||||
GdkMemoryFormat
|
||||
gdk_memory_depth_get_alpha_format (GdkMemoryDepth depth)
|
||||
{
|
||||
switch (depth)
|
||||
{
|
||||
case GDK_MEMORY_U8:
|
||||
return GDK_MEMORY_A8;
|
||||
case GDK_MEMORY_U16:
|
||||
return GDK_MEMORY_A16;
|
||||
case GDK_MEMORY_FLOAT16:
|
||||
return GDK_MEMORY_A16_FLOAT;
|
||||
case GDK_MEMORY_FLOAT32:
|
||||
return GDK_MEMORY_A32_FLOAT;
|
||||
default:
|
||||
g_return_val_if_reached (GDK_MEMORY_A8);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_memory_format_gl_format (GdkMemoryFormat format,
|
||||
gboolean gles,
|
||||
|
@ -44,6 +44,7 @@ gsize gdk_memory_format_bytes_per_pixel (GdkMemoryFormat
|
||||
GdkMemoryDepth gdk_memory_format_get_depth (GdkMemoryFormat format) G_GNUC_CONST;
|
||||
GdkMemoryDepth gdk_memory_depth_merge (GdkMemoryDepth depth1,
|
||||
GdkMemoryDepth depth2) G_GNUC_CONST;
|
||||
GdkMemoryFormat gdk_memory_depth_get_alpha_format (GdkMemoryDepth depth) G_GNUC_CONST;
|
||||
gboolean gdk_memory_format_gl_format (GdkMemoryFormat format,
|
||||
gboolean gles,
|
||||
guint gl_major,
|
||||
|
Loading…
Reference in New Issue
Block a user