From bca7804bb6e1bf5ce5a99b9ae4806be25e36993c Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 27 Apr 2024 12:43:12 +0100 Subject: internal: Window storage rework - part 1 (#5762) * Window storage rework - part 1 * format * remove useless include * fix pch * format * fix crash in dwindle * fix vram leak * prefer .expired() for bool checks --- src/render/OpenGL.hpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/render/OpenGL.hpp') diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index 32e2f1eb..bbd022e7 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -7,6 +7,7 @@ #include "../helpers/Region.hpp" #include #include +#include #include @@ -151,12 +152,12 @@ class CHyprOpenGLImpl { void blend(bool enabled); - void makeWindowSnapshot(CWindow*); - void makeRawWindowSnapshot(CWindow*, CFramebuffer*); + void makeWindowSnapshot(PHLWINDOW); + void makeRawWindowSnapshot(PHLWINDOW, CFramebuffer*); void makeLayerSnapshot(SLayerSurface*); - void renderSnapshot(CWindow**); + void renderSnapshot(PHLWINDOW); void renderSnapshot(SLayerSurface**); - bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow); + bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, PHLWINDOW pWindow); void clear(const CColor&); void clearWithTex(); @@ -192,13 +193,13 @@ class CHyprOpenGLImpl { bool m_bReloadScreenShader = true; // at launch it can be set - CWindow* m_pCurrentWindow = nullptr; // hack to get the current rendered window - SLayerSurface* m_pCurrentLayer = nullptr; // hack to get the current rendered layer + PHLWINDOWREF m_pCurrentWindow; // hack to get the current rendered window + SLayerSurface* m_pCurrentLayer = nullptr; // hack to get the current rendered layer - std::unordered_map m_mWindowFramebuffers; - std::unordered_map m_mLayerFramebuffers; - std::unordered_map m_mMonitorRenderResources; - std::unordered_map m_mMonitorBGFBs; + std::map> m_mWindowFramebuffers; + std::unordered_map m_mLayerFramebuffers; + std::unordered_map m_mMonitorRenderResources; + std::unordered_map m_mMonitorBGFBs; struct { PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glEGLImageTargetRenderbufferStorageOES = nullptr; -- cgit v1.2.3