diff options
| author | Tom Englund <tomenglund26@gmail.com> | 2026-04-05 20:37:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-05 19:37:07 +0100 |
| commit | 809b9b9e78c69c53b62dfc7d5de5c20ff8fe0626 (patch) | |
| tree | c54f0261aad8e01e9dc7abcfefafb056cd448ac3 /src/managers | |
| parent | 5c5ba65ad32aa59c9e769d7b2ae62ea632d773f0 (diff) | |
egl: move over to use hyprgraphics (#12988)
use the hyprgraphics helpers instead.
Diffstat (limited to 'src/managers')
| -rw-r--r-- | src/managers/screenshare/CursorshareSession.cpp | 10 | ||||
| -rw-r--r-- | src/managers/screenshare/ScreenshareFrame.cpp | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/managers/screenshare/CursorshareSession.cpp b/src/managers/screenshare/CursorshareSession.cpp index a1664487..f093cfd8 100644 --- a/src/managers/screenshare/CursorshareSession.cpp +++ b/src/managers/screenshare/CursorshareSession.cpp @@ -5,7 +5,9 @@ #include "../../render/Renderer.hpp" #include "../../render/pass/ClearPassElement.hpp" #include "../../render/pass/TexPassElement.hpp" +#include <hyprgraphics/egl/Egl.hpp> +using namespace Hyprgraphics::Egl; using namespace Screenshare; CCursorshareSession::CCursorshareSession(wl_client* client, WP<CWLPointerResource> pointer) : m_client(client), m_pointer(pointer) { @@ -164,7 +166,7 @@ bool CCursorshareSession::copy() { callback(RESULT_COPIED); }); } else if (auto attrs = m_pendingFrame.buffer->shm(); attrs.success) { - const auto PFORMAT = NFormatUtils::getPixelFormatFromDRM(m_format); + const auto PFORMAT = getPixelFormatFromDRM(m_format); if (attrs.format != m_format || !PFORMAT) { LOGM(Log::ERR, "Can't copy: invalid format"); @@ -190,11 +192,9 @@ bool CCursorshareSession::copy() { if (glFormat != GL_BGRA_EXT && glFormat != GL_RGB) { if (PFORMAT->swizzle.has_value()) { - std::array<GLint, 4> RGBA = SWIZZLE_RGBA; - std::array<GLint, 4> BGRA = SWIZZLE_BGRA; - if (PFORMAT->swizzle == RGBA) + if (PFORMAT->swizzle == SWIZZLE_RGBA) glFormat = GL_RGBA; - else if (PFORMAT->swizzle == BGRA) + else if (PFORMAT->swizzle == SWIZZLE_BGRA) glFormat = GL_BGRA_EXT; else { LOGM(Log::ERR, "Copied frame via shm might be broken or color flipped"); diff --git a/src/managers/screenshare/ScreenshareFrame.cpp b/src/managers/screenshare/ScreenshareFrame.cpp index 9f9dffa6..6d110837 100644 --- a/src/managers/screenshare/ScreenshareFrame.cpp +++ b/src/managers/screenshare/ScreenshareFrame.cpp @@ -14,7 +14,9 @@ #include "../../render/pass/RectPassElement.hpp" #include "helpers/cm/ColorManagement.hpp" #include <hyprutils/math/Region.hpp> +#include <hyprgraphics/egl/Egl.hpp> +using namespace Hyprgraphics::Egl; using namespace Screenshare; CScreenshareFrame::CScreenshareFrame(WP<CScreenshareSession> session, bool overlayCursor, bool isFirst) : @@ -395,7 +397,7 @@ bool CScreenshareFrame::copyShm() { auto shm = m_buffer->shm(); - const auto PFORMAT = NFormatUtils::getPixelFormatFromDRM(shm.format); + const auto PFORMAT = getPixelFormatFromDRM(shm.format); if (!PFORMAT) { LOGM(Log::ERR, "Can't copy: failed to find a pixel format"); return false; |
