Hyprland/src/helpers/sync/SyncReleaser.hpp
Ikalco 2ee5118d7a
render: properly release rendered buffers (#9807)
* cleanup eglSync

* properly release buffers in renderer

* add renderingDoneCallback and use it in screencopy

* use static constructor for CEGLSync
2025-04-30 18:35:25 +02:00

31 lines
751 B
C++

#pragma once
#include <cstdint>
#include <optional>
#include <vector>
#include <functional>
#include <hyprutils/os/FileDescriptor.hpp>
#include "../memory/Memory.hpp"
/*
A helper (inspired by KDE's KWin) that will release the timeline point in the dtor
*/
class CSyncTimeline;
class CSyncReleaser {
public:
CSyncReleaser(SP<CSyncTimeline> timeline, uint64_t point);
~CSyncReleaser();
// drops the releaser, will never signal anymore
void drop();
// wait for this sync_fd to signal before releasing
void addSyncFileFd(const Hyprutils::OS::CFileDescriptor& syncFd);
private:
SP<CSyncTimeline> m_timeline;
uint64_t m_point = 0;
Hyprutils::OS::CFileDescriptor m_fd;
};