From bb958a9e139d6ae90d45fe360287d33e229f971e Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Fri, 4 Jul 2025 09:58:37 +0200 Subject: pass: overload TexPass constructor overload it with a rvalue to allow us to move the data directly avoiding an extra copy. because SRenderData is not trivially copyable. --- src/render/pass/TexPassElement.cpp | 6 +++++- src/render/pass/TexPassElement.hpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/render/pass') diff --git a/src/render/pass/TexPassElement.cpp b/src/render/pass/TexPassElement.cpp index c4b00220..dbf40308 100644 --- a/src/render/pass/TexPassElement.cpp +++ b/src/render/pass/TexPassElement.cpp @@ -4,7 +4,11 @@ #include using namespace Hyprutils::Utils; -CTexPassElement::CTexPassElement(const CTexPassElement::SRenderData& data_) : m_data(data_) { +CTexPassElement::CTexPassElement(const SRenderData& data) : m_data(data) { + ; +} + +CTexPassElement::CTexPassElement(CTexPassElement::SRenderData&& data) : m_data(std::move(data)) { ; } diff --git a/src/render/pass/TexPassElement.hpp b/src/render/pass/TexPassElement.hpp index a9206d2d..4257357e 100644 --- a/src/render/pass/TexPassElement.hpp +++ b/src/render/pass/TexPassElement.hpp @@ -24,6 +24,7 @@ class CTexPassElement : public IPassElement { }; CTexPassElement(const SRenderData& data); + CTexPassElement(SRenderData&& data); virtual ~CTexPassElement() = default; virtual void draw(const CRegion& damage); -- cgit v1.2.3