From 38a7f03cf0e5ee116794a78581634ba3dab508fa Mon Sep 17 00:00:00 2001 From: UjinT34 <41110182+UjinT34@users.noreply.github.com> Date: Sun, 29 Mar 2026 00:41:45 +0300 Subject: renderer: refactor part 7: api fixes (#13631) Part 7 of ujin's refactors --------- Co-authored-by: Vaxry --- src/render/Framebuffer.hpp | 55 +++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 22 deletions(-) (limited to 'src/render/Framebuffer.hpp') diff --git a/src/render/Framebuffer.hpp b/src/render/Framebuffer.hpp index 7e33f227..215e5ed9 100644 --- a/src/render/Framebuffer.hpp +++ b/src/render/Framebuffer.hpp @@ -3,38 +3,49 @@ #include "../defines.hpp" #include "../helpers/Format.hpp" #include "Texture.hpp" +#include "../helpers/cm/ColorManagement.hpp" #include #include 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, DRMFormat 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 getMirrorTexture(); + SP getStencilTex(); + void enableMirror(SP tex); + void disableMirror(); + NColorManagement::PImageDescription imageDescription(); + void setImageDescription(NColorManagement::PImageDescription desc); - 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, DRMFormat format = DRM_FORMAT_ARGB8888) = 0; - SP m_tex; - bool m_fbAllocated = false; + SP m_tex; + SP m_mirrorTex; + bool m_fbAllocated = false; - SP m_stencilTex; - std::string m_name; // name for logging -}; + SP m_stencilTex; + std::string m_name; // name for logging + + NColorManagement::PImageDescription m_imageDescription; + }; +} -- cgit v1.2.3