From f5af40afce9d453dbf2e5bab739520e1cb80ab12 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Thu, 10 Jul 2025 10:44:59 +0200 Subject: renderpass: use unique ptr instead of shared ptr lets use unique ptrs instead of refcounting shared ptr when its not needed, use rvalue reference to construct in vector directly. --- src/render/decorations/CHyprGroupBarDecoration.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/render/decorations/CHyprGroupBarDecoration.cpp') diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index e577658a..df8731be 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -172,21 +172,21 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) { double first = rect.w - (*PROUNDING * 2); rectdata.round = *PROUNDING; rectdata.clipBox = CBox{rect.pos() - Vector2D{PADDING, 0.F}, Vector2D{first + PADDING, rect.h}}; - g_pHyprRenderer->m_renderPass.add(makeShared(rectdata)); + g_pHyprRenderer->m_renderPass.add(makeUnique(rectdata)); rectdata.round = 0; rectdata.clipBox = CBox{rect.pos() + Vector2D{first, 0.F}, Vector2D{rect.w - first + PADDING, rect.h}}; } else if (i == barsToDraw - 1) { double first = *PROUNDING * 2; rectdata.round = 0; rectdata.clipBox = CBox{rect.pos() - Vector2D{PADDING, 0.F}, Vector2D{first + PADDING, rect.h}}; - g_pHyprRenderer->m_renderPass.add(makeShared(rectdata)); + g_pHyprRenderer->m_renderPass.add(makeUnique(rectdata)); rectdata.round = *PROUNDING; rectdata.clipBox = CBox{rect.pos() + Vector2D{first, 0.F}, Vector2D{rect.w - first + PADDING, rect.h}}; } } else rectdata.round = *PROUNDING; } - g_pHyprRenderer->m_renderPass.add(makeShared(rectdata)); + g_pHyprRenderer->m_renderPass.add(makeUnique(rectdata)); } rect = {ASSIGNEDBOX.x + xoff - pMonitor->m_position.x + m_window->m_floatingOffset.x, @@ -212,21 +212,21 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) { double first = rect.w - (*PGRADIENTROUNDING * 2); data.round = *PGRADIENTROUNDING; data.clipBox = CBox{rect.pos() - Vector2D{PADDING, 0.F}, Vector2D{first + PADDING, rect.h}}; - g_pHyprRenderer->m_renderPass.add(makeShared(data)); + g_pHyprRenderer->m_renderPass.add(makeUnique(data)); data.round = 0; data.clipBox = CBox{rect.pos() + Vector2D{first, 0.F}, Vector2D{rect.w - first + PADDING, rect.h}}; } else if (i == barsToDraw - 1) { double first = *PGRADIENTROUNDING * 2; data.round = 0; data.clipBox = CBox{rect.pos() - Vector2D{PADDING, 0.F}, Vector2D{first + PADDING, rect.h}}; - g_pHyprRenderer->m_renderPass.add(makeShared(data)); + g_pHyprRenderer->m_renderPass.add(makeUnique(data)); data.round = *PGRADIENTROUNDING; data.clipBox = CBox{rect.pos() + Vector2D{first, 0.F}, Vector2D{rect.w - first + PADDING, rect.h}}; } } else data.round = *PGRADIENTROUNDING; } - g_pHyprRenderer->m_renderPass.add(makeShared(data)); + g_pHyprRenderer->m_renderPass.add(makeUnique(data)); } } @@ -256,7 +256,7 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) { data.tex = titleTex; data.box = rect; data.a = a; - g_pHyprRenderer->m_renderPass.add(makeShared(std::move(data))); + g_pHyprRenderer->m_renderPass.add(makeUnique(std::move(data))); } } -- cgit v1.2.3