diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-05-22 22:06:40 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-05-22 22:06:40 +0200 |
| commit | d1ec314a03473124ffadf8dd8aea33c317dfc1d0 (patch) | |
| tree | fd3b45ff2b10eabdb2075f540b9772f691e24ce9 /src/render/decorations/CHyprGroupBarDecoration.cpp | |
| parent | 7bcc01efb7d6523ad573e54d9f80fc570f53cb89 (diff) | |
groupbars: conserve VRAM by staticizing textures
Diffstat (limited to 'src/render/decorations/CHyprGroupBarDecoration.cpp')
| -rw-r--r-- | src/render/decorations/CHyprGroupBarDecoration.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index c2a65f56..1db7952c 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -3,6 +3,11 @@ #include <ranges> #include <pango/pangocairo.h> +// shared things to conserve VRAM +static std::deque<std::unique_ptr<CTitleTex>> m_dpTitleTextures; +static CTexture m_tGradientActive; +static CTexture m_tGradientInactive; + CHyprGroupBarDecoration::CHyprGroupBarDecoration(CWindow* pWindow) { m_pWindow = pWindow; } @@ -166,8 +171,11 @@ void CHyprGroupBarDecoration::clearUnusedTextures() { for (auto& tex : m_dpTitleTextures | std::views::reverse) { bool found = false; - for (auto& w : m_dwGroupMembers) { - if (tex->szContent == w->m_szTitle && tex->pWindowOwner == w) { + for (auto& w : g_pCompositor->m_vWindows) { + if (!w->m_sGroupData.pNextWindow) + continue; + + if (tex->szContent == w->m_szTitle && tex->pWindowOwner == w.get()) { found = true; break; } |
