Hyprland/src/helpers/MonitorFrameScheduler.hpp
Vaxry d84699d8e5
opengl: detect android fence support and disable explicit if it's missing (#11077)
Checks for explicit sync support via the android fences, and falls back to implicit sync if it isn't
2025-07-19 12:38:41 +02:00

36 lines
973 B
C++

#pragma once
#include "Monitor.hpp"
#include <chrono>
class CEGLSync;
class CMonitorFrameScheduler {
public:
using hrc = std::chrono::high_resolution_clock;
CMonitorFrameScheduler(PHLMONITOR m);
CMonitorFrameScheduler(const CMonitorFrameScheduler&) = delete;
CMonitorFrameScheduler(CMonitorFrameScheduler&&) = delete;
CMonitorFrameScheduler& operator=(const CMonitorFrameScheduler&) = delete;
CMonitorFrameScheduler& operator=(CMonitorFrameScheduler&&) = delete;
void onSyncFired();
void onPresented();
void onFrame();
private:
bool canRender();
void onFinishRender();
bool newSchedulingEnabled();
bool m_renderAtFrame = true;
bool m_pendingThird = false;
hrc::time_point m_lastRenderBegun;
PHLMONITORREF m_monitor;
UP<CEGLSync> m_sync;
};