diff options
| author | UjinT34 <41110182+UjinT34@users.noreply.github.com> | 2026-03-07 16:13:34 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-07 13:13:34 +0000 |
| commit | 966f20d305345b3042dc1d37a1dd8833f3a4783b (patch) | |
| tree | 3e8515b7a0f6fde7bf3137aac7124ae90e5951ec /src/protocols | |
| parent | 32e75e3e320fb66ab517a378df645f3d29b3a209 (diff) | |
renderer: refactor resources and flags (#13471)
Diffstat (limited to 'src/protocols')
| -rw-r--r-- | src/protocols/ImageCopyCapture.cpp | 5 | ||||
| -rw-r--r-- | src/protocols/LinuxDMABUF.cpp | 3 | ||||
| -rw-r--r-- | src/protocols/MesaDRM.cpp | 5 | ||||
| -rw-r--r-- | src/protocols/SinglePixel.cpp | 2 | ||||
| -rw-r--r-- | src/protocols/core/Shm.cpp | 2 |
5 files changed, 8 insertions, 9 deletions
diff --git a/src/protocols/ImageCopyCapture.cpp b/src/protocols/ImageCopyCapture.cpp index eca3c939..b9cc25e2 100644 --- a/src/protocols/ImageCopyCapture.cpp +++ b/src/protocols/ImageCopyCapture.cpp @@ -7,6 +7,7 @@ #include "../desktop/view/Window.hpp" #include "../render/OpenGL.hpp" #include "../desktop/state/FocusState.hpp" +#include "render/Renderer.hpp" #include <cstring> using namespace Screenshare; @@ -72,7 +73,7 @@ void CImageCopyCaptureSession::sendConstraints() { for (DRMFormat format : formats) { m_resource->sendShmFormat(NFormatUtils::drmToShm(format)); - auto modifiers = g_pHyprOpenGL->getDRMFormatModifiers(format); + auto modifiers = g_pHyprRenderer->getDRMFormatModifiers(format); wl_array modsArr; wl_array_init(&modsArr); @@ -287,7 +288,7 @@ void CImageCopyCaptureCursorSession::sendConstraints() { m_sessionResource->sendShmFormat(NFormatUtils::drmToShm(format)); - auto modifiers = g_pHyprOpenGL->getDRMFormatModifiers(format); + auto modifiers = g_pHyprRenderer->getDRMFormatModifiers(format); wl_array modsArr; wl_array_init(&modsArr); diff --git a/src/protocols/LinuxDMABUF.cpp b/src/protocols/LinuxDMABUF.cpp index f16c8c56..0a395a1f 100644 --- a/src/protocols/LinuxDMABUF.cpp +++ b/src/protocols/LinuxDMABUF.cpp @@ -8,6 +8,7 @@ #include <fcntl.h> #include <sys/stat.h> #include "core/Compositor.hpp" +#include "render/Renderer.hpp" #include "types/DMABuffer.hpp" #include "types/WLBuffer.hpp" #include "../render/OpenGL.hpp" @@ -449,7 +450,7 @@ CLinuxDMABufV1Protocol::CLinuxDMABufV1Protocol(const wl_interface* iface, const SDMABUFTranche eglTranche = { .device = m_mainDevice, .flags = 0, // renderer isn't for ds so don't set flag. - .formats = g_pHyprOpenGL->getDRMFormats(), + .formats = g_pHyprRenderer->getDRMFormats(), }; std::vector<std::pair<PHLMONITORREF, SDMABUFTranche>> tches; diff --git a/src/protocols/MesaDRM.cpp b/src/protocols/MesaDRM.cpp index 8a0b08b7..c73d98cc 100644 --- a/src/protocols/MesaDRM.cpp +++ b/src/protocols/MesaDRM.cpp @@ -2,6 +2,7 @@ #include <algorithm> #include <xf86drm.h> #include "../Compositor.hpp" +#include "render/Renderer.hpp" #include "types/WLBuffer.hpp" #include "../render/OpenGL.hpp" @@ -61,7 +62,7 @@ CMesaDRMResource::CMesaDRMResource(SP<CWlDrm> resource_) : m_resource(resource_) uint64_t mod = DRM_FORMAT_MOD_INVALID; - auto fmts = g_pHyprOpenGL->getDRMFormats(); + auto fmts = g_pHyprRenderer->getDRMFormats(); for (auto const& f : fmts) { if (f.drmFormat != fmt) continue; @@ -101,7 +102,7 @@ CMesaDRMResource::CMesaDRMResource(SP<CWlDrm> resource_) : m_resource(resource_) m_resource->sendDevice(PROTO::mesaDRM->m_nodeName.c_str()); m_resource->sendCapabilities(WL_DRM_CAPABILITY_PRIME); - auto fmts = g_pHyprOpenGL->getDRMFormats(); + auto fmts = g_pHyprRenderer->getDRMFormats(); for (auto const& fmt : fmts) { m_resource->sendFormat(fmt.drmFormat); } diff --git a/src/protocols/SinglePixel.cpp b/src/protocols/SinglePixel.cpp index c32379a3..c4d83805 100644 --- a/src/protocols/SinglePixel.cpp +++ b/src/protocols/SinglePixel.cpp @@ -8,8 +8,6 @@ CSinglePixelBuffer::CSinglePixelBuffer(uint32_t id, wl_client* client, CHyprColo m_color = col_.getAsHex(); - g_pHyprRenderer->makeEGLCurrent(); - m_opaque = col_.a >= 1.F; m_texture = g_pHyprRenderer->createTexture(DRM_FORMAT_ARGB8888, rc<uint8_t*>(&m_color), 4, Vector2D{1, 1}); diff --git a/src/protocols/core/Shm.cpp b/src/protocols/core/Shm.cpp index 7cca3814..c6f01b50 100644 --- a/src/protocols/core/Shm.cpp +++ b/src/protocols/core/Shm.cpp @@ -16,8 +16,6 @@ CWLSHMBuffer::CWLSHMBuffer(WP<CWLSHMPoolResource> pool_, uint32_t id, int32_t of if UNLIKELY (!pool_->m_pool->m_data) return; - g_pHyprRenderer->makeEGLCurrent(); - size = size_; m_pool = pool_->m_pool; m_stride = stride_; |
