From 809b9b9e78c69c53b62dfc7d5de5c20ff8fe0626 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Sun, 5 Apr 2026 20:37:07 +0200 Subject: egl: move over to use hyprgraphics (#12988) use the hyprgraphics helpers instead. --- src/helpers/Format.hpp | 50 ++++++-------------------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) (limited to 'src/helpers/Format.hpp') diff --git a/src/helpers/Format.hpp b/src/helpers/Format.hpp index 02925e22..e0dfcd3a 100644 --- a/src/helpers/Format.hpp +++ b/src/helpers/Format.hpp @@ -9,51 +9,13 @@ using DRMFormat = uint32_t; using SHMFormat = uint32_t; -#define SWIZZLE_A1GB {GL_ALPHA, GL_ONE, GL_GREEN, GL_BLUE} -#define SWIZZLE_ABG1 {GL_ALPHA, GL_BLUE, GL_GREEN, GL_ONE} -#define SWIZZLE_ABGR {GL_ALPHA, GL_BLUE, GL_GREEN, GL_RED} -#define SWIZZLE_ARGB {GL_ALPHA, GL_RED, GL_GREEN, GL_BLUE} -#define SWIZZLE_B1RG {GL_BLUE, GL_ONE, GL_RED, GL_GREEN} -#define SWIZZLE_BARG {GL_BLUE, GL_ALPHA, GL_RED, GL_GREEN} -#define SWIZZLE_BGR1 {GL_BLUE, GL_GREEN, GL_RED, GL_ONE} -#define SWIZZLE_BGRA {GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA} -#define SWIZZLE_G1AB {GL_GREEN, GL_ONE, GL_ALPHA, GL_BLUE} -#define SWIZZLE_GBA1 {GL_GREEN, GL_BLUE, GL_ALPHA, GL_ONE} -#define SWIZZLE_GBAR {GL_GREEN, GL_BLUE, GL_ALPHA, GL_RED} -#define SWIZZLE_GRAB {GL_GREEN, GL_RED, GL_ALPHA, GL_BLUE} -#define SWIZZLE_R001 {GL_RED, GL_ZERO, GL_ZERO, GL_ONE} -#define SWIZZLE_R1BG {GL_RED, GL_ONE, GL_BLUE, GL_GREEN} -#define SWIZZLE_RABG {GL_RED, GL_ALPHA, GL_BLUE, GL_GREEN} -#define SWIZZLE_RG01 {GL_RED, GL_GREEN, GL_ZERO, GL_ONE} -#define SWIZZLE_GR01 {GL_GREEN, GL_RED, GL_ZERO, GL_ONE} -#define SWIZZLE_RGB1 {GL_RED, GL_GREEN, GL_BLUE, GL_ONE} -#define SWIZZLE_RGBA {GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA} - -struct SPixelFormat { - DRMFormat drmFormat = 0; /* DRM_FORMAT_INVALID */ - int glInternalFormat = 0; - int glFormat = 0; - int glType = 0; - bool withAlpha = true; - DRMFormat alphaStripped = 0; /* DRM_FORMAT_INVALID */ - uint32_t bytesPerBlock = 0; - Vector2D blockSize; - std::optional> swizzle = std::nullopt; -}; - using SDRMFormat = Aquamarine::SDRMFormat; namespace NFormatUtils { - SHMFormat drmToShm(DRMFormat drm); - DRMFormat shmToDRM(SHMFormat shm); - - const SPixelFormat* getPixelFormatFromDRM(DRMFormat drm); - const SPixelFormat* getPixelFormatFromGL(uint32_t glFormat, uint32_t glType, bool alpha); - bool isFormatYUV(uint32_t drmFormat); - bool isFormatOpaque(DRMFormat drm); - int pixelsPerBlock(const SPixelFormat* const fmt); - int minStride(const SPixelFormat* const fmt, int32_t width); - std::string drmFormatName(DRMFormat drm); - std::string drmModifierName(uint64_t mod); - DRMFormat alphaFormat(DRMFormat prevFormat); + SHMFormat drmToShm(DRMFormat drm); + DRMFormat shmToDRM(SHMFormat shm); + bool isFormatYUV(uint32_t drmFormat); + std::string drmFormatName(DRMFormat drm); + std::string drmModifierName(uint64_t mod); + DRMFormat alphaFormat(DRMFormat prevFormat); }; -- cgit v1.2.3