Changeset View
Changeset View
Standalone View
Standalone View
plugins/qpa/offscreensurface.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | ||||
3 | This file is part of the KDE project. | ||||
4 | | ||||
5 | Copyright (C) 2019 Vlad Zagorodniy <vladzzag@gmail.com> | ||||
6 | | ||||
7 | This program is free software; you can redistribute it and/or modify | ||||
8 | it under the terms of the GNU General Public License as published by | ||||
9 | the Free Software Foundation; either version 2 of the License, or | ||||
10 | (at your option) any later version. | ||||
11 | | ||||
12 | This program is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | GNU General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU General Public License | ||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | | ||||
21 | #pragma once | ||||
22 | | ||||
23 | #define MESA_EGL_NO_X11_HEADERS | ||||
24 | #include <epoxy/egl.h> | ||||
25 | #include "fixqopengl.h" | ||||
26 | | ||||
27 | #include <qpa/qplatformoffscreensurface.h> | ||||
28 | | ||||
29 | namespace KWin | ||||
30 | { | ||||
31 | namespace QPA | ||||
32 | { | ||||
33 | | ||||
34 | class OffscreenSurface : public QPlatformOffscreenSurface | ||||
35 | { | ||||
36 | public: | ||||
37 | explicit OffscreenSurface(QOffscreenSurface *surface); | ||||
38 | ~OffscreenSurface() override; | ||||
39 | | ||||
40 | QSurfaceFormat format() const override; | ||||
41 | bool isValid() const override; | ||||
42 | | ||||
43 | EGLSurface nativeHandle() const; | ||||
44 | | ||||
45 | private: | ||||
46 | QSurfaceFormat m_format; | ||||
47 | | ||||
48 | EGLDisplay m_eglDisplay = EGL_NO_DISPLAY; | ||||
49 | EGLSurface m_surface = EGL_NO_SURFACE; | ||||
50 | }; | ||||
51 | | ||||
52 | } // namespace QPA | ||||
53 | } // namespace KWin |