KWin
Loading...
Searching...
No Matches
eglnativefence.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <epoxy/egl.h>
10
11#include "kwin_export.h"
13
14namespace KWin
15{
16
17class EglDisplay;
18
19class KWIN_EXPORT EGLNativeFence
20{
21public:
22 explicit EGLNativeFence(EglDisplay *display);
23 explicit EGLNativeFence(EglDisplay *display, EGLSyncKHR sync);
25 EGLNativeFence(const EGLNativeFence &) = delete;
27
28 bool isValid() const;
29 const FileDescriptor &fileDescriptor() const;
30 bool waitSync() const;
31
32 static EGLNativeFence importFence(EglDisplay *display, FileDescriptor &&fd);
33
34private:
35 EGLSyncKHR m_sync = EGL_NO_SYNC_KHR;
36 EglDisplay *m_display = nullptr;
37 FileDescriptor m_fileDescriptor;
38};
39
40} // namespace KWin
EGLNativeFence(EGLNativeFence &&)=delete
EGLNativeFence(const EGLNativeFence &)=delete