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/protocols/Screencopy.cpp | 6 ++++-- src/protocols/ToplevelExport.cpp | 6 ++++-- src/protocols/core/Shm.cpp | 5 ++++- src/protocols/types/DMABuffer.cpp | 4 +++- 4 files changed, 15 insertions(+), 6 deletions(-) (limited to 'src/protocols') diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index 825939ef..75c23026 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -5,7 +5,9 @@ #include "types/Buffer.hpp" #include "../helpers/Format.hpp" #include "../helpers/time/Time.hpp" +#include +using namespace Hyprgraphics::Egl; using namespace Screenshare; CScreencopyClient::CScreencopyClient(SP resource_) : m_resource(resource_) { @@ -74,7 +76,7 @@ CScreencopyFrame::CScreencopyFrame(SP resource_, WPbufferSize(); - const auto PSHMINFO = NFormatUtils::getPixelFormatFromDRM(format); + const auto PSHMINFO = getPixelFormatFromDRM(format); if (!PSHMINFO) { LOGM(Log::ERR, "No pixel format for drm format"); @@ -82,7 +84,7 @@ CScreencopyFrame::CScreencopyFrame(SP resource_, WPsendBuffer(NFormatUtils::drmToShm(format), bufSize.x, bufSize.y, stride); if (m_resource->version() >= 3) { diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp index 7b3d0c89..5536e3d7 100644 --- a/src/protocols/ToplevelExport.cpp +++ b/src/protocols/ToplevelExport.cpp @@ -6,7 +6,9 @@ #include "../render/Renderer.hpp" #include +#include +using namespace Hyprgraphics::Egl; using namespace Screenshare; CToplevelExportClient::CToplevelExportClient(SP resource_) : m_resource(resource_) { @@ -73,8 +75,8 @@ CToplevelExportFrame::CToplevelExportFrame(SP re DRMFormat format = formats.at(0); auto bufSize = m_frame->bufferSize(); - const auto PSHMINFO = NFormatUtils::getPixelFormatFromDRM(format); - const auto stride = NFormatUtils::minStride(PSHMINFO, bufSize.x); + const auto PSHMINFO = getPixelFormatFromDRM(format); + const auto stride = minStride(PSHMINFO, bufSize.x); m_resource->sendBuffer(NFormatUtils::drmToShm(format), bufSize.x, bufSize.y, stride); if LIKELY (format != DRM_FORMAT_INVALID) diff --git a/src/protocols/core/Shm.cpp b/src/protocols/core/Shm.cpp index c6f01b50..660458ab 100644 --- a/src/protocols/core/Shm.cpp +++ b/src/protocols/core/Shm.cpp @@ -7,6 +7,9 @@ #include "../types/WLBuffer.hpp" #include "../../helpers/Format.hpp" #include "../../render/Renderer.hpp" +#include + +using namespace Hyprgraphics::Egl; using namespace Hyprutils::OS; CWLSHMBuffer::CWLSHMBuffer(WP pool_, uint32_t id, int32_t offset_, const Vector2D& size_, int32_t stride_, uint32_t fmt_) { @@ -21,7 +24,7 @@ CWLSHMBuffer::CWLSHMBuffer(WP pool_, uint32_t id, int32_t of m_stride = stride_; m_fmt = fmt_; m_offset = offset_; - m_opaque = NFormatUtils::isFormatOpaque(NFormatUtils::shmToDRM(fmt_)); + m_opaque = isDrmFormatOpaque(NFormatUtils::shmToDRM(fmt_)); m_resource = CWLBufferResource::create(makeShared(pool_->m_resource->client(), 1, id)); diff --git a/src/protocols/types/DMABuffer.cpp b/src/protocols/types/DMABuffer.cpp index 86db8ca6..37c46338 100644 --- a/src/protocols/types/DMABuffer.cpp +++ b/src/protocols/types/DMABuffer.cpp @@ -3,6 +3,7 @@ #include "../../desktop/view/LayerSurface.hpp" #include "../../render/Renderer.hpp" #include "../../helpers/Format.hpp" +#include #if defined(__linux__) #include @@ -11,6 +12,7 @@ #include using namespace Hyprutils::OS; +using namespace Hyprgraphics::Egl; CDMABuffer::CDMABuffer(uint32_t id, wl_client* client, Aquamarine::SDMABUFAttrs const& attrs_) : m_attrs(attrs_) { m_listeners.resourceDestroy = events.destroy.listen([this] { @@ -20,7 +22,7 @@ CDMABuffer::CDMABuffer(uint32_t id, wl_client* client, Aquamarine::SDMABUFAttrs size = m_attrs.size; m_resource = CWLBufferResource::create(makeShared(client, 1, id)); - m_opaque = NFormatUtils::isFormatOpaque(m_attrs.format); + m_opaque = isDrmFormatOpaque(m_attrs.format); m_texture = g_pHyprRenderer->createTexture(m_attrs, m_opaque); // texture takes ownership of the eglImage if UNLIKELY (!m_texture) { -- cgit v1.2.3