rendernode: Make sure depth variable has enough bits

This will be relevant when we add new values to it.
This commit is contained in:
Benjamin Otte
2024-07-03 18:36:49 +02:00
parent 3539128d42
commit dd33a2f280
3 changed files with 5 additions and 1 deletions

View File

@@ -28,6 +28,8 @@
#include <epoxy/gl.h>
G_STATIC_ASSERT ((1 << GDK_MEMORY_DEPTH_BITS) > GDK_N_DEPTHS);
typedef struct _GdkMemoryFormatDescription GdkMemoryFormatDescription;
#define TYPED_FUNCS(name, T, R, G, B, A, bpp, scale) \

View File

@@ -45,6 +45,8 @@ typedef enum {
GDK_N_DEPTHS
} GdkMemoryDepth;
#define GDK_MEMORY_DEPTH_BITS 3
gsize gdk_memory_format_alignment (GdkMemoryFormat format) G_GNUC_CONST;
GdkMemoryAlpha gdk_memory_format_alpha (GdkMemoryFormat format) G_GNUC_CONST;
gsize gdk_memory_format_bytes_per_pixel (GdkMemoryFormat format) G_GNUC_CONST;

View File

@@ -32,7 +32,7 @@ struct _GskRenderNode
graphene_rect_t bounds;
guint preferred_depth : 2;
guint preferred_depth : GDK_MEMORY_DEPTH_BITS;
guint offscreen_for_opacity : 1;
};