From 063a9fda0f4a6278b8f5ea8bb1be7a158f460374 Mon Sep 17 00:00:00 2001 From: UjinT34 Date: Sat, 7 Mar 2026 22:29:37 +0300 Subject: [PATCH] namespace render interfaces --- src/debug/HyprDebugOverlay.hpp | 2 +- src/debug/HyprNotificationOverlay.hpp | 2 +- src/desktop/view/LayerSurface.hpp | 2 +- src/desktop/view/Popup.hpp | 6 +- src/desktop/view/Window.hpp | 2 +- src/helpers/Monitor.hpp | 18 ++--- src/helpers/cm/ColorManagement.hpp | 6 +- src/hyprerror/HyprError.cpp | 2 +- src/hyprerror/HyprError.hpp | 34 ++++---- src/managers/PointerManager.cpp | 4 +- src/managers/PointerManager.hpp | 12 +-- .../screenshare/ScreenshareManager.hpp | 26 +++--- src/protocols/types/Buffer.hpp | 2 +- src/protocols/types/SurfaceState.cpp | 2 +- src/protocols/types/SurfaceState.hpp | 8 +- src/render/Framebuffer.cpp | 2 + src/render/Framebuffer.hpp | 46 ++++++----- src/render/Renderbuffer.cpp | 2 + src/render/Renderbuffer.hpp | 34 ++++---- src/render/Renderer.hpp | 2 +- src/render/Texture.cpp | 2 + src/render/Texture.hpp | 80 ++++++++++--------- src/render/Transformer.hpp | 2 +- .../decorations/CHyprGroupBarDecoration.cpp | 2 + .../decorations/CHyprGroupBarDecoration.hpp | 12 +-- src/render/pass/Pass.hpp | 66 ++++++++------- src/render/pass/SurfacePassElement.hpp | 6 +- src/render/pass/TexPassElement.hpp | 8 +- src/render/pass/TextureMatteElement.hpp | 12 +-- 29 files changed, 217 insertions(+), 187 deletions(-) diff --git a/src/debug/HyprDebugOverlay.hpp b/src/debug/HyprDebugOverlay.hpp index b263138c3..375ecc2c0 100644 --- a/src/debug/HyprDebugOverlay.hpp +++ b/src/debug/HyprDebugOverlay.hpp @@ -44,7 +44,7 @@ class CHyprDebugOverlay { cairo_surface_t* m_cairoSurface = nullptr; cairo_t* m_cairo = nullptr; - SP m_texture; + SP m_texture; friend class CHyprMonitorDebugOverlay; friend class Render::IHyprRenderer; diff --git a/src/debug/HyprNotificationOverlay.hpp b/src/debug/HyprNotificationOverlay.hpp index ec7aed722..c2ecbfe09 100644 --- a/src/debug/HyprNotificationOverlay.hpp +++ b/src/debug/HyprNotificationOverlay.hpp @@ -57,7 +57,7 @@ class CHyprNotificationOverlay { PHLMONITORREF m_lastMonitor; Vector2D m_lastSize = Vector2D(-1, -1); - SP m_texture; + SP m_texture; }; inline UP g_pHyprNotificationOverlay; diff --git a/src/desktop/view/LayerSurface.hpp b/src/desktop/view/LayerSurface.hpp index d2f5f0702..a8cc7acd2 100644 --- a/src/desktop/view/LayerSurface.hpp +++ b/src/desktop/view/LayerSurface.hpp @@ -60,7 +60,7 @@ namespace Desktop::View { std::string m_namespace = ""; SP m_popupHead; - SP m_snapshotFB; + SP m_snapshotFB; pid_t getPID(); diff --git a/src/desktop/view/Popup.hpp b/src/desktop/view/Popup.hpp index 39b8d714d..9280056c7 100644 --- a/src/desktop/view/Popup.hpp +++ b/src/desktop/view/Popup.hpp @@ -58,10 +58,10 @@ namespace Desktop::View { bool m_mapped = false; // fade in-out - PHLANIMVAR m_alpha; - bool m_fadingOut = false; + PHLANIMVAR m_alpha; + bool m_fadingOut = false; - SP m_snapshotFB; + SP m_snapshotFB; private: CPopup(); diff --git a/src/desktop/view/Window.hpp b/src/desktop/view/Window.hpp index 23dd01177..3f6d2be82 100644 --- a/src/desktop/view/Window.hpp +++ b/src/desktop/view/Window.hpp @@ -255,7 +255,7 @@ namespace Desktop::View { const uint64_t m_stableID = 0x2137; // snapshots - SP m_snapshotFB; + SP m_snapshotFB; // ANR PHLANIMVAR m_notRespondingTint; diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp index 7a8b2e7b9..eddb159f1 100644 --- a/src/helpers/Monitor.hpp +++ b/src/helpers/Monitor.hpp @@ -119,8 +119,8 @@ class CMonitor { Config::CMonitorRule m_activeMonitorRule; - SP m_splash; - SP m_background; + SP m_splash; + SP m_background; // explicit sync Hyprutils::OS::CFileDescriptor m_inFence; // TODO: remove when aq uses CFileDescriptor @@ -132,15 +132,15 @@ class CMonitor { // mirroring PHLMONITORREF m_mirrorOf; std::vector m_mirrors; - SP m_monitorMirrorFB; + SP m_monitorMirrorFB; // rendering fb - SP m_offloadFB; - SP m_mirrorFB; // these are used for some effects, - SP m_mirrorSwapFB; // etc - SP m_offMainFB; - SP m_blurFB; - SP m_stencilTex; + SP m_offloadFB; + SP m_mirrorFB; // these are used for some effects, + SP m_mirrorSwapFB; // etc + SP m_offMainFB; + SP m_blurFB; + SP m_stencilTex; // TODO fix blur ignore alpha and remove // ctm Mat3x3 m_ctm = Mat3x3::identity(); diff --git a/src/helpers/cm/ColorManagement.hpp b/src/helpers/cm/ColorManagement.hpp index 0103e2a40..2787ae652 100644 --- a/src/helpers/cm/ColorManagement.hpp +++ b/src/helpers/cm/ColorManagement.hpp @@ -17,7 +17,9 @@ #define HDR_REF_LUMINANCE 203.0 #define HLG_MAX_LUMINANCE 1000.0 -class ITexture; +namespace Render { + class ITexture; +} namespace NColorManagement { enum eNoShader : uint8_t { @@ -219,7 +221,7 @@ namespace NColorManagement { bool present = false; size_t lutSize = 33; std::vector lutDataPacked; - SP lutTexture; + SP lutTexture; std::optional vcgt; } icc; diff --git a/src/hyprerror/HyprError.cpp b/src/hyprerror/HyprError.cpp index 3f180b954..32332895a 100644 --- a/src/hyprerror/HyprError.cpp +++ b/src/hyprerror/HyprError.cpp @@ -244,7 +244,7 @@ float CHyprError::height() { return m_lastHeight; } -SP CHyprError::texture() { +SP CHyprError::texture() { if (!m_texture) m_texture = g_pHyprRenderer->createTexture(); return m_texture; diff --git a/src/hyprerror/HyprError.hpp b/src/hyprerror/HyprError.hpp index 8bb3eb68a..f9c522836 100644 --- a/src/hyprerror/HyprError.hpp +++ b/src/hyprerror/HyprError.hpp @@ -11,28 +11,28 @@ class CHyprError { CHyprError(); ~CHyprError() = default; - void queueCreate(std::string message, const CHyprColor& color); - void queueError(std::string err); - void draw(); - void destroy(); + void queueCreate(std::string message, const CHyprColor& color); + void queueError(std::string err); + void draw(); + void destroy(); - bool active(); - float height(); // logical + bool active(); + float height(); // logical - SP texture(); + SP texture(); private: - void createQueued(); - std::string m_queued = ""; - CHyprColor m_queuedColor; - bool m_queuedDestroy = false; - bool m_isCreated = false; - SP m_texture; - PHLANIMVAR m_fadeOpacity; - CBox m_damageBox = {0, 0, 0, 0}; - float m_lastHeight = 0.F; + void createQueued(); + std::string m_queued = ""; + CHyprColor m_queuedColor; + bool m_queuedDestroy = false; + bool m_isCreated = false; + SP m_texture; + PHLANIMVAR m_fadeOpacity; + CBox m_damageBox = {0, 0, 0, 0}; + float m_lastHeight = 0.F; - bool m_monitorChanged = false; + bool m_monitorChanged = false; }; inline UP g_pHyprError; // This is a full-screen error. Treat it with respect, and there can only be one at a time. diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index cf6838fce..1122a4439 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -411,7 +411,7 @@ bool CPointerManager::setHWCursorBuffer(SP state, SP CPointerManager::renderHWCursorBuffer(SP state, SP texture) { +SP CPointerManager::renderHWCursorBuffer(SP state, SP texture) { auto maxSize = state->monitor->m_output->cursorPlaneSize(); auto const& cursorSize = m_currentCursorImage.size; @@ -905,7 +905,7 @@ const CPointerManager::SCursorImage& CPointerManager::currentCursorImage() { return m_currentCursorImage; } -SP CPointerManager::getCurrentCursorTexture() { +SP CPointerManager::getCurrentCursorTexture() { if (!m_currentCursorImage.pBuffer && (!m_currentCursorImage.surface || !m_currentCursorImage.surface->resource()->m_current.texture)) return nullptr; diff --git a/src/managers/PointerManager.hpp b/src/managers/PointerManager.hpp index a4fe1971f..41e8e32a0 100644 --- a/src/managers/PointerManager.hpp +++ b/src/managers/PointerManager.hpp @@ -12,7 +12,9 @@ class CMonitor; class IHID; -class ITexture; +namespace Render { + class ITexture; +} AQUAMARINE_FORWARD(IBuffer); @@ -71,7 +73,7 @@ class CPointerManager { struct SCursorImage { SP pBuffer; - SP bufferTex; + SP bufferTex; WP surface; Vector2D hotspot; @@ -82,8 +84,8 @@ class CPointerManager { CHyprSignalListener commitSurface; }; - const SCursorImage& currentCursorImage(); - SP getCurrentCursorTexture(); + const SCursorImage& currentCursorImage(); + SP getCurrentCursorTexture(); struct { CSignalT<> cursorChanged; @@ -181,7 +183,7 @@ class CPointerManager { std::vector> m_monitorStates; SP stateFor(PHLMONITOR mon); bool attemptHardwareCursor(SP state); - SP renderHWCursorBuffer(SP state, SP texture); + SP renderHWCursorBuffer(SP state, SP texture); bool setHWCursorBuffer(SP state, SP buf); struct { diff --git a/src/managers/screenshare/ScreenshareManager.hpp b/src/managers/screenshare/ScreenshareManager.hpp index 5a4ada5e4..56ecf52dd 100644 --- a/src/managers/screenshare/ScreenshareManager.hpp +++ b/src/managers/screenshare/ScreenshareManager.hpp @@ -61,24 +61,24 @@ namespace Screenshare { CScreenshareSession(PHLMONITOR monitor, CBox captureRegion, wl_client* client); CScreenshareSession(PHLWINDOW window, wl_client* client); - WP m_self; - bool m_stopped = false; + WP m_self; + bool m_stopped = false; - eScreenshareType m_type = SHARE_NONE; - PHLMONITORREF m_monitor; - PHLWINDOWREF m_window; - CBox m_captureBox = {}; // given capture area in logical coordinates (see xdg_output) + eScreenshareType m_type = SHARE_NONE; + PHLMONITORREF m_monitor; + PHLWINDOWREF m_window; + CBox m_captureBox = {}; // given capture area in logical coordinates (see xdg_output) - wl_client* m_client = nullptr; - std::string m_name = ""; + wl_client* m_client = nullptr; + std::string m_name = ""; - std::vector m_formats; - Vector2D m_bufferSize = Vector2D(0, 0); + std::vector m_formats; + Vector2D m_bufferSize = Vector2D(0, 0); - SP m_tempFB; + SP m_tempFB; - SP m_shareStopTimer; - bool m_sharing = false; + SP m_shareStopTimer; + bool m_sharing = false; struct { CHyprSignalListener monitorDestroyed; diff --git a/src/protocols/types/Buffer.hpp b/src/protocols/types/Buffer.hpp index afff11a5d..927cd2591 100644 --- a/src/protocols/types/Buffer.hpp +++ b/src/protocols/types/Buffer.hpp @@ -26,7 +26,7 @@ class IHLBuffer : public Aquamarine::IBuffer { void onBackendRelease(const std::function& fn); void addReleasePoint(CDRMSyncPointState& point); - SP m_texture; + SP m_texture; bool m_opaque = false; SP m_resource; std::vector> m_syncReleasers; diff --git a/src/protocols/types/SurfaceState.cpp b/src/protocols/types/SurfaceState.cpp index da98d3fbe..7e1baaad8 100644 --- a/src/protocols/types/SurfaceState.cpp +++ b/src/protocols/types/SurfaceState.cpp @@ -35,7 +35,7 @@ CRegion SSurfaceState::accumulateBufferDamage() { return bufferDamage; } -void SSurfaceState::updateSynchronousTexture(SP lastTexture) { +void SSurfaceState::updateSynchronousTexture(SP lastTexture) { auto [dataPtr, fmt, size] = buffer->beginDataPtr(0); if (dataPtr) { auto drmFmt = NFormatUtils::shmToDRM(fmt); diff --git a/src/protocols/types/SurfaceState.hpp b/src/protocols/types/SurfaceState.hpp index d5b7e4b9b..9a12a0807 100644 --- a/src/protocols/types/SurfaceState.hpp +++ b/src/protocols/types/SurfaceState.hpp @@ -6,7 +6,9 @@ #include "../WaylandProtocol.hpp" #include "./Buffer.hpp" -class ITexture; +namespace Render { + class ITexture; +} class CDRMSyncPointState; class CWLCallbackResource; @@ -88,8 +90,8 @@ struct SSurfaceState { eLockReason lockMask = LOCK_REASON_NONE; // texture of surface content, used for rendering - SP texture; - void updateSynchronousTexture(SP lastTexture); + SP texture; + void updateSynchronousTexture(SP lastTexture); // fifo bool barrierSet = false; diff --git a/src/render/Framebuffer.cpp b/src/render/Framebuffer.cpp index b2ff7e68a..08970a9f3 100644 --- a/src/render/Framebuffer.cpp +++ b/src/render/Framebuffer.cpp @@ -1,5 +1,7 @@ #include "Framebuffer.hpp" +using namespace Render; + IFramebuffer::IFramebuffer(const std::string& name) : m_name(name) {} bool IFramebuffer::alloc(int w, int h, uint32_t format) { diff --git a/src/render/Framebuffer.hpp b/src/render/Framebuffer.hpp index 7e33f227f..ebefb9dbb 100644 --- a/src/render/Framebuffer.hpp +++ b/src/render/Framebuffer.hpp @@ -8,33 +8,35 @@ class CHLBufferReference; -class IFramebuffer { - public: - IFramebuffer() = default; - IFramebuffer(const std::string& name); - virtual ~IFramebuffer() = default; +namespace Render { + class IFramebuffer { + public: + IFramebuffer() = default; + IFramebuffer(const std::string& name); + virtual ~IFramebuffer() = default; - virtual bool alloc(int w, int h, uint32_t format = DRM_FORMAT_ARGB8888); - virtual void release() = 0; - virtual bool readPixels(CHLBufferReference buffer, uint32_t offsetX = 0, uint32_t offsetY = 0, uint32_t width = 0, uint32_t height = 0) = 0; + virtual bool alloc(int w, int h, uint32_t format = DRM_FORMAT_ARGB8888); + virtual void release() = 0; + virtual bool readPixels(CHLBufferReference buffer, uint32_t offsetX = 0, uint32_t offsetY = 0, uint32_t width = 0, uint32_t height = 0) = 0; - virtual void bind() = 0; + virtual void bind() = 0; - bool isAllocated(); - SP getTexture(); - SP getStencilTex(); + bool isAllocated(); + SP getTexture(); + SP getStencilTex(); - virtual void addStencil(SP tex) = 0; + virtual void addStencil(SP tex) = 0; - Vector2D m_size; - DRMFormat m_drmFormat = DRM_FORMAT_INVALID; + Vector2D m_size; + DRMFormat m_drmFormat = DRM_FORMAT_INVALID; - protected: - virtual bool internalAlloc(int w, int h, uint32_t format = DRM_FORMAT_ARGB8888) = 0; + protected: + virtual bool internalAlloc(int w, int h, uint32_t format = DRM_FORMAT_ARGB8888) = 0; - SP m_tex; - bool m_fbAllocated = false; + SP m_tex; + bool m_fbAllocated = false; - SP m_stencilTex; - std::string m_name; // name for logging -}; + SP m_stencilTex; + std::string m_name; // name for logging + }; +} diff --git a/src/render/Renderbuffer.cpp b/src/render/Renderbuffer.cpp index 5ecbe8450..34ce3e6a2 100644 --- a/src/render/Renderbuffer.cpp +++ b/src/render/Renderbuffer.cpp @@ -7,6 +7,8 @@ #include +using namespace Render; + IRenderbuffer::IRenderbuffer(SP buffer, uint32_t format) : m_hlBuffer(buffer) { m_listeners.destroyBuffer = buffer->events.destroy.listen([this] { g_pHyprRenderer->onRenderbufferDestroy(this); }); } diff --git a/src/render/Renderbuffer.hpp b/src/render/Renderbuffer.hpp index c33144d3e..e19af22fe 100644 --- a/src/render/Renderbuffer.hpp +++ b/src/render/Renderbuffer.hpp @@ -5,24 +5,26 @@ #include "Framebuffer.hpp" #include -class IRenderbuffer { - public: - IRenderbuffer(SP buffer, uint32_t format); - virtual ~IRenderbuffer() = default; +namespace Render { + class IRenderbuffer { + public: + IRenderbuffer(SP buffer, uint32_t format); + virtual ~IRenderbuffer() = default; - bool good(); - SP getFB(); + bool good(); + SP getFB(); - virtual void bind() = 0; - virtual void unbind() = 0; + virtual void bind() = 0; + virtual void unbind() = 0; - WP m_hlBuffer; + WP m_hlBuffer; - protected: - SP m_framebuffer; - bool m_good = false; + protected: + SP m_framebuffer; + bool m_good = false; - struct { - CHyprSignalListener destroyBuffer; - } m_listeners; -}; + struct { + CHyprSignalListener destroyBuffer; + } m_listeners; + }; +} diff --git a/src/render/Renderer.hpp b/src/render/Renderer.hpp index 02a6c9d7e..f536cc59f 100644 --- a/src/render/Renderer.hpp +++ b/src/render/Renderer.hpp @@ -33,7 +33,6 @@ class CWorkspace; class CInputPopup; class IHLBuffer; class CEventLoopTimer; -class CRenderPass; class CToplevelExportProtocolManager; class CInputManager; struct SSessionLockSurface; @@ -43,6 +42,7 @@ namespace Screenshare { namespace Render { class IElementRenderer; + class CRenderPass; class IHyprRenderer { public: diff --git a/src/render/Texture.cpp b/src/render/Texture.cpp index 28ae4b41b..1201f0445 100644 --- a/src/render/Texture.cpp +++ b/src/render/Texture.cpp @@ -1,6 +1,8 @@ #include "Texture.hpp" #include +using namespace Render; + ITexture::ITexture(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const Vector2D& size, bool keepDataCopy, bool opaque) : m_size(size), m_opaque(opaque), m_drmFormat(drmFormat), m_keepDataCopy(keepDataCopy) { if (m_keepDataCopy && stride && pixels) { diff --git a/src/render/Texture.hpp b/src/render/Texture.hpp index 38c3ff016..2c6d6c09f 100644 --- a/src/render/Texture.hpp +++ b/src/render/Texture.hpp @@ -8,51 +8,53 @@ class IHLBuffer; HYPRUTILS_FORWARD(Math, CRegion); -enum eTextureType : int8_t { - TEXTURE_INVALID = -1, // Invalid - TEXTURE_RGBA = 0, // 4 channels - TEXTURE_RGBX, // discard A - TEXTURE_3D_LUT, // 3D LUT - TEXTURE_EXTERNAL, // EGLImage -}; +namespace Render { + enum eTextureType : int8_t { + TEXTURE_INVALID = -1, // Invalid + TEXTURE_RGBA = 0, // 4 channels + TEXTURE_RGBX, // discard A + TEXTURE_3D_LUT, // 3D LUT + TEXTURE_EXTERNAL, // EGLImage + }; -class ITexture { - public: - ITexture(ITexture&) = delete; - ITexture(ITexture&&) = delete; - ITexture(const ITexture&&) = delete; - ITexture(const ITexture&) = delete; + class ITexture { + public: + ITexture(ITexture&) = delete; + ITexture(ITexture&&) = delete; + ITexture(const ITexture&&) = delete; + ITexture(const ITexture&) = delete; - virtual ~ITexture() = default; + virtual ~ITexture() = default; - virtual void setTexParameter(GLenum pname, GLint param) = 0; - virtual void allocate(const Vector2D& size, uint32_t drmFormat = 0) = 0; - virtual void update(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const CRegion& damage) = 0; - virtual void bind() {}; - virtual void unbind() {}; - virtual bool ok(); - virtual bool isDMA(); + virtual void setTexParameter(GLenum pname, GLint param) = 0; + virtual void allocate(const Vector2D& size, uint32_t drmFormat = 0) = 0; + virtual void update(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const CRegion& damage) = 0; + virtual void bind() {}; + virtual void unbind() {}; + virtual bool ok(); + virtual bool isDMA(); - const std::vector& dataCopy(); + const std::vector& dataCopy(); - eTextureType m_type = TEXTURE_RGBA; - Vector2D m_size = {}; - eTransform m_transform = HYPRUTILS_TRANSFORM_NORMAL; - bool m_opaque = false; + eTextureType m_type = TEXTURE_RGBA; + Vector2D m_size = {}; + eTransform m_transform = HYPRUTILS_TRANSFORM_NORMAL; + bool m_opaque = false; - uint32_t m_drmFormat = 0; // for shm - bool m_isSynchronous = false; + uint32_t m_drmFormat = 0; // for shm + bool m_isSynchronous = false; - // TODO move to GLTexture - GLuint m_texID = 0; - GLenum magFilter = GL_LINEAR; // useNearestNeighbor overwrites these - GLenum minFilter = GL_LINEAR; + // TODO move to GLTexture + GLuint m_texID = 0; + GLenum magFilter = GL_LINEAR; // useNearestNeighbor overwrites these + GLenum minFilter = GL_LINEAR; - protected: - ITexture() = default; - ITexture(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const Vector2D& size, bool keepDataCopy = false, bool opaque = false); - ITexture(std::span lut3D, size_t N); + protected: + ITexture() = default; + ITexture(uint32_t drmFormat, uint8_t* pixels, uint32_t stride, const Vector2D& size, bool keepDataCopy = false, bool opaque = false); + ITexture(std::span lut3D, size_t N); - bool m_keepDataCopy = false; - std::vector m_dataCopy; -}; + bool m_keepDataCopy = false; + std::vector m_dataCopy; + }; +} diff --git a/src/render/Transformer.hpp b/src/render/Transformer.hpp index 8f4018591..992bd24f7 100644 --- a/src/render/Transformer.hpp +++ b/src/render/Transformer.hpp @@ -14,7 +14,7 @@ class IWindowTransformer { // called by Hyprland. For more data about what is being rendered, inspect render data. // returns the out fb. - virtual IFramebuffer* transform(IFramebuffer* in) = 0; + virtual Render::IFramebuffer* transform(Render::IFramebuffer* in) = 0; // called by Hyprland before a window main pass is started. virtual void preWindowRender(CSurfacePassElement::SRenderData* pRenderData); diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 63efc016f..e392184dd 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -12,6 +12,8 @@ #include "../../layout/LayoutManager.hpp" #include "../../layout/supplementary/DragController.hpp" +using namespace Render; + // shared things to conserve VRAM static SP m_tGradientActive; static SP m_tGradientInactive; diff --git a/src/render/decorations/CHyprGroupBarDecoration.hpp b/src/render/decorations/CHyprGroupBarDecoration.hpp index 5c3f4ae57..f6581c8d6 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.hpp +++ b/src/render/decorations/CHyprGroupBarDecoration.hpp @@ -12,13 +12,13 @@ class CTitleTex { CTitleTex(PHLWINDOW pWindow, const Vector2D& bufferSize, const float monitorScale); ~CTitleTex() = default; - SP m_texActive; - SP m_texInactive; - SP m_texLockedActive; - SP m_texLockedInactive; - std::string m_content; + SP m_texActive; + SP m_texInactive; + SP m_texLockedActive; + SP m_texLockedInactive; + std::string m_content; - PHLWINDOWREF m_windowOwner; + PHLWINDOWREF m_windowOwner; }; void refreshGroupBarGradients(); diff --git a/src/render/pass/Pass.hpp b/src/render/pass/Pass.hpp index d407bf3c4..5a85d067e 100644 --- a/src/render/pass/Pass.hpp +++ b/src/render/pass/Pass.hpp @@ -3,40 +3,44 @@ #include "../../defines.hpp" #include "PassElement.hpp" -class ITexture; +class CGradientValueData; -class CRenderPass { - public: - bool empty() const; - bool single() const; +namespace Render { + class ITexture; - void add(UP&& elem); - void clear(); - void removeAllOfType(const std::string& type); + class CRenderPass { + public: + bool empty() const; + bool single() const; - CRegion render(const CRegion& damage_); + void add(UP&& elem); + void clear(); + void removeAllOfType(const std::string& type); - private: - CRegion m_damage; - std::vector m_occludedRegions; - CRegion m_totalLiveBlurRegion; + CRegion render(const CRegion& damage_); - struct SPassElementData { - CRegion elementDamage; - UP element; - bool discard = false; + private: + CRegion m_damage; + std::vector m_occludedRegions; + CRegion m_totalLiveBlurRegion; + + struct SPassElementData { + CRegion elementDamage; + UP element; + bool discard = false; + }; + + std::vector> m_passElements; + + void simplify(); + float oneBlurRadius(); + void renderDebugData(); + + struct { + bool present = false; + SP keyboardFocusText, pointerFocusText, lastWindowText; + } m_debugData; + + friend class CHyprOpenGLImpl; }; - - std::vector> m_passElements; - - void simplify(); - float oneBlurRadius(); - void renderDebugData(); - - struct { - bool present = false; - SP keyboardFocusText, pointerFocusText, lastWindowText; - } m_debugData; - - friend class CHyprOpenGLImpl; -}; +} diff --git a/src/render/pass/SurfacePassElement.hpp b/src/render/pass/SurfacePassElement.hpp index c76b475d0..ebf5561c7 100644 --- a/src/render/pass/SurfacePassElement.hpp +++ b/src/render/pass/SurfacePassElement.hpp @@ -5,7 +5,9 @@ #include "../../helpers/time/Time.hpp" class CWLSurfaceResource; -class ITexture; +namespace Render { + class ITexture; +} class CSyncTimeline; class CSurfacePassElement : public IPassElement { @@ -17,7 +19,7 @@ class CSurfacePassElement : public IPassElement { void* data = nullptr; SP surface = nullptr; - SP texture = nullptr; + SP texture = nullptr; bool mainSurface = true; double w = 0, h = 0; int rounding = 0; diff --git a/src/render/pass/TexPassElement.hpp b/src/render/pass/TexPassElement.hpp index 5b8c9757c..6c0cfab11 100644 --- a/src/render/pass/TexPassElement.hpp +++ b/src/render/pass/TexPassElement.hpp @@ -3,7 +3,9 @@ #include class CWLSurfaceResource; -class ITexture; +namespace Render { + class ITexture; +} class CSyncTimeline; enum eDiscardMode : uint8_t { @@ -14,7 +16,7 @@ enum eDiscardMode : uint8_t { class CTexPassElement : public IPassElement { public: struct SRenderData { - SP tex; + SP tex; CBox box; float a = 1.F; float blurA = 1.F; @@ -41,7 +43,7 @@ class CTexPassElement : public IPassElement { CRegion clipRegion; PHLLSREF currentLS; - SP blurredBG; + SP blurredBG; }; CTexPassElement(const SRenderData& data); diff --git a/src/render/pass/TextureMatteElement.hpp b/src/render/pass/TextureMatteElement.hpp index bf3bb4bfd..03526a57f 100644 --- a/src/render/pass/TextureMatteElement.hpp +++ b/src/render/pass/TextureMatteElement.hpp @@ -2,15 +2,17 @@ #include "PassElement.hpp" #include "../Framebuffer.hpp" -class ITexture; +namespace Render { + class ITexture; +} class CTextureMatteElement : public IPassElement { public: struct STextureMatteData { - CBox box; - SP tex; - SP fb; - bool disableTransformAndModify = false; + CBox box; + SP tex; + SP fb; + bool disableTransformAndModify = false; }; CTextureMatteElement(const STextureMatteData& data_);