Benjamin Otte
dd4b8a4c89
gl: Pass swizzle array directly
...
There's no need to pass pointers to arrays, as arrays are already
pointers.
2023-08-12 23:13:23 +02:00
Benjamin Otte
b1b8a98568
gdk: Add function to query alpha format for depth
...
It's meant to be used in renderers.
2023-07-22 01:33:44 +02:00
Benjamin Otte
8b8dfcdfb4
rendernode: Change to gsk_render_node_get_preferred_depth()
...
Instead of just tracking preferred_high_depth(), track the actual depth
we'd like to have.
2023-06-18 14:26:18 +02:00
Benjamin Otte
9015ed1c43
memoryformat: Add gdk_memory_format_get_depth()
...
Replace gdk_memory_format_prefers_high_depth with the more generic
gdk_memory_format_get_depth() that returns the depth of the individual
channels.
Also make the GL renderer use that to pick the generic F16 format
instead of immediately going for F32 when uploading textures.
2023-06-18 14:26:18 +02:00
Sophie Herold
ef8c835762
gsk: Support swizzle for gray and alpha formats
...
Swizzling is needed to display one channel memory formats
as gray etc.
2023-05-30 14:41:01 -04:00
Benjamin Otte
8965d6c7f8
gl: Only allow RGB(A)8 on GLES2
...
GLES2 has no idea what 16bit textures even are, let alone floating point.
2023-04-17 05:57:44 +02:00
Matthias Clasen
a1c5a806b3
Convert headers to #pragma once
...
The conversion was done by guard2one.
2023-03-31 15:11:10 -04:00
Benjamin Otte
d726ecdb5d
gdk: Split enums from types
...
Add gdkenums.h for enums and keep gdktypes.h for types.
Makes both files easier to read.
2021-10-26 20:59:37 +02:00
Benjamin Otte
dcba783389
gdk: Rework gdk_pixbuf_get_from_texture()
...
Make it use gdk_memory_texture_from_texture().
Also make gdk_memory_format_alpha() privately available so that we can
detect if an image contains an alpha channel.
2021-10-18 12:08:57 +02:00
Benjamin Otte
7a50ebaa3f
gdk: Move GdkMemoryFormat enum to gdktypes.h
...
It's used in too many places now.
2021-10-16 15:49:37 +02:00
Benjamin Otte
afa004fb8b
memoryformat: Add gdk_memory_format_prefers_high_depth()
...
This is unused so far, but is part of preparations for high depth
support in renderers.
2021-10-06 22:50:07 +02:00
Benjamin Otte
149395c306
gl: Move memory <=> GL format mapping
...
Put it into gdkmemoryformat.c, where all the mapping goes.
2021-10-06 22:50:07 +02:00
Benjamin Otte
48781cf7f7
memorytexture: Split out GdkMemoryFormat handling
...
Also, now make gdk_memory_convert() the only conversion functions
and allow conversions between any 2 formats by going via a float[4].
This could be optimized via fast-paths, but so far it isn't.
2021-10-06 22:50:07 +02:00