summaryrefslogtreecommitdiff
path: root/src/protocols
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2026-04-05 20:37:07 +0200
committerGitHub <noreply@github.com>2026-04-05 19:37:07 +0100
commit809b9b9e78c69c53b62dfc7d5de5c20ff8fe0626 (patch)
treec54f0261aad8e01e9dc7abcfefafb056cd448ac3 /src/protocols
parent5c5ba65ad32aa59c9e769d7b2ae62ea632d773f0 (diff)
egl: move over to use hyprgraphics (#12988)
use the hyprgraphics helpers instead.
Diffstat (limited to 'src/protocols')
-rw-r--r--src/protocols/Screencopy.cpp6
-rw-r--r--src/protocols/ToplevelExport.cpp6
-rw-r--r--src/protocols/core/Shm.cpp5
-rw-r--r--src/protocols/types/DMABuffer.cpp4
4 files changed, 15 insertions, 6 deletions
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 <hyprgraphics/egl/Egl.hpp>
+using namespace Hyprgraphics::Egl;
using namespace Screenshare;
CScreencopyClient::CScreencopyClient(SP<CZwlrScreencopyManagerV1> resource_) : m_resource(resource_) {
@@ -74,7 +76,7 @@ CScreencopyFrame::CScreencopyFrame(SP<CZwlrScreencopyFrameV1> resource_, WP<CScr
DRMFormat format = formats.at(0);
auto bufSize = m_frame->bufferSize();
- 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<CZwlrScreencopyFrameV1> resource_, WP<CScr
return;
}
- const auto stride = NFormatUtils::minStride(PSHMINFO, bufSize.x);
+ const auto stride = minStride(PSHMINFO, bufSize.x);
m_resource->sendBuffer(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 <hyprutils/math/Vector2D.hpp>
+#include <hyprgraphics/egl/Egl.hpp>
+using namespace Hyprgraphics::Egl;
using namespace Screenshare;
CToplevelExportClient::CToplevelExportClient(SP<CHyprlandToplevelExportManagerV1> resource_) : m_resource(resource_) {
@@ -73,8 +75,8 @@ CToplevelExportFrame::CToplevelExportFrame(SP<CHyprlandToplevelExportFrameV1> 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 <hyprgraphics/egl/Egl.hpp>
+
+using namespace Hyprgraphics::Egl;
using namespace Hyprutils::OS;
CWLSHMBuffer::CWLSHMBuffer(WP<CWLSHMPoolResource> pool_, uint32_t id, int32_t offset_, const Vector2D& size_, int32_t stride_, uint32_t fmt_) {
@@ -21,7 +24,7 @@ CWLSHMBuffer::CWLSHMBuffer(WP<CWLSHMPoolResource> 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<CWlBuffer>(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 <hyprgraphics/egl/Egl.hpp>
#if defined(__linux__)
#include <linux/dma-buf.h>
@@ -11,6 +12,7 @@
#include <sys/ioctl.h>
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<CWlBuffer>(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) {