eglnativefence.h 553 Bytes
Newer Older
1 2 3 4 5 6 7 8
/*
    SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>

    SPDX-License-Identifier: GPL-2.0-or-later
*/

#pragma once

9 10
#include <QtGlobal>

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#include <epoxy/egl.h>

namespace KWin
{

class EGLNativeFence
{
public:
    explicit EGLNativeFence(EGLDisplay display);
    ~EGLNativeFence();

    bool isValid() const;
    int fileDescriptor() const;

private:
    EGLSyncKHR m_sync = EGL_NO_SYNC_KHR;
    EGLDisplay m_display = EGL_NO_DISPLAY;
    int m_fileDescriptor = -1;

    Q_DISABLE_COPY(EGLNativeFence)
};

} // namespace KWin