KWin
Loading...
Searching...
No Matches
x11syncmanager.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2014 Fredrik Höglund <fredrik@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "opengl/glutils.h"
10
11#include <xcb/sync.h>
12#include <xcb/xcb.h>
13
14namespace KWin
15{
16
22{
23public:
31
34
35 State state() const
36 {
37 return m_state;
38 }
39
40 void trigger();
41 void wait();
42 bool finish();
43 void reset();
44 void finishResetting();
45
46private:
47 State m_state;
48 GLsync m_sync;
49 xcb_sync_fence_t m_fence;
50 xcb_get_input_focus_cookie_t m_reset_cookie;
51};
52
58{
59public:
60 enum {
62 };
63
64 static X11SyncManager *create();
66
67 bool endFrame();
68
69 void triggerFence();
70 void insertWait();
71
72private:
74
75 X11SyncObject *m_currentFence = nullptr;
76 QList<X11SyncObject *> m_fences;
77 int m_next = 0;
78};
79
80} // namespace KWin
static X11SyncManager * create()
State state() const