#pragma once #include "../defines.hpp" #include "../helpers/Monitor.hpp" #include "../render/Texture.hpp" #include #include #include class CHyprRenderer; class CHyprMonitorDebugOverlay { public: int draw(int offset); void renderData(CMonitor* pMonitor, float µs); void renderDataNoOverlay(CMonitor* pMonitor, float µs); void frameData(CMonitor* pMonitor); private: std::deque m_dLastFrametimes; std::deque m_dLastRenderTimes; std::deque m_dLastRenderTimesNoOverlay; std::deque m_dLastAnimationTicks; std::chrono::high_resolution_clock::time_point m_tpLastFrame; CMonitor* m_pMonitor = nullptr; CBox m_wbLastDrawnBox; friend class CHyprRenderer; }; class CHyprDebugOverlay { public: CHyprDebugOverlay(); void draw(); void renderData(CMonitor*, float µs); void renderDataNoOverlay(CMonitor*, float µs); void frameData(CMonitor*); private: std::unordered_map m_mMonitorOverlays; cairo_surface_t* m_pCairoSurface = nullptr; cairo_t* m_pCairo = nullptr; SP m_pTexture; friend class CHyprMonitorDebugOverlay; friend class CHyprRenderer; }; inline std::unique_ptr g_pDebugOverlay;