Changeset View
Changeset View
Standalone View
Standalone View
plugins/qpa/window.h
Show All 19 Lines | |||||
20 | #ifndef KWIN_QPA_WINDOW_H | 20 | #ifndef KWIN_QPA_WINDOW_H | ||
21 | #define KWIN_QPA_WINDOW_H | 21 | #define KWIN_QPA_WINDOW_H | ||
22 | 22 | | |||
23 | #include <epoxy/egl.h> | 23 | #include <epoxy/egl.h> | ||
24 | #include "fixqopengl.h" | 24 | #include "fixqopengl.h" | ||
25 | 25 | | |||
26 | #include <fixx11h.h> | 26 | #include <fixx11h.h> | ||
27 | #include <qpa/qplatformwindow.h> | 27 | #include <qpa/qplatformwindow.h> | ||
28 | // wayland | | |||
29 | #include <config-kwin.h> | | |||
30 | #if HAVE_WAYLAND_EGL | | |||
31 | #include <wayland-egl.h> | | |||
32 | #endif | | |||
33 | 28 | | |||
34 | class QOpenGLFramebufferObject; | 29 | class QOpenGLFramebufferObject; | ||
35 | 30 | | |||
36 | #if HAVE_WAYLAND_EGL | | |||
37 | struct wl_egl_window; | | |||
38 | #endif | | |||
39 | 31 | | |||
40 | namespace KWayland | 32 | namespace KWayland | ||
41 | { | 33 | { | ||
42 | namespace Client | 34 | namespace Client | ||
43 | { | 35 | { | ||
44 | class Surface; | 36 | class Surface; | ||
45 | class ShellSurface; | 37 | class ShellSurface; | ||
46 | } | 38 | } | ||
Show All 17 Lines | 53 | public: | |||
64 | 56 | | |||
65 | void setVisible(bool visible) override; | 57 | void setVisible(bool visible) override; | ||
66 | void setGeometry(const QRect &rect) override; | 58 | void setGeometry(const QRect &rect) override; | ||
67 | WId winId() const override; | 59 | WId winId() const override; | ||
68 | 60 | | |||
69 | KWayland::Client::Surface *surface() const { | 61 | KWayland::Client::Surface *surface() const { | ||
70 | return m_surface; | 62 | return m_surface; | ||
71 | } | 63 | } | ||
72 | EGLSurface eglSurface() const { | | |||
73 | return m_eglSurface; | | |||
74 | } | | |||
75 | void createEglSurface(EGLDisplay dpy, EGLConfig config); | | |||
76 | 64 | | |||
77 | int scale() const; | 65 | int scale() const; | ||
78 | qreal devicePixelRatio() const override; | 66 | qreal devicePixelRatio() const override; | ||
79 | 67 | | |||
80 | void bindContentFBO(); | 68 | void bindContentFBO(); | ||
81 | const QSharedPointer<QOpenGLFramebufferObject> &contentFBO() const { | 69 | const QSharedPointer<QOpenGLFramebufferObject> &contentFBO() const { | ||
82 | return m_contentFBO; | 70 | return m_contentFBO; | ||
83 | } | 71 | } | ||
84 | QSharedPointer<QOpenGLFramebufferObject> swapFBO(); | 72 | QSharedPointer<QOpenGLFramebufferObject> swapFBO(); | ||
85 | ShellClient *shellClient(); | 73 | ShellClient *shellClient(); | ||
86 | 74 | | |||
87 | private: | 75 | private: | ||
88 | void unmap(); | 76 | void unmap(); | ||
89 | void createFBO(); | 77 | void createFBO(); | ||
90 | 78 | | |||
91 | KWayland::Client::Surface *m_surface; | 79 | KWayland::Client::Surface *m_surface; | ||
92 | KWayland::Client::ShellSurface *m_shellSurface; | 80 | KWayland::Client::ShellSurface *m_shellSurface; | ||
93 | EGLSurface m_eglSurface = EGL_NO_SURFACE; | | |||
94 | QSharedPointer<QOpenGLFramebufferObject> m_contentFBO; | 81 | QSharedPointer<QOpenGLFramebufferObject> m_contentFBO; | ||
95 | bool m_resized = false; | 82 | bool m_resized = false; | ||
96 | ShellClient *m_shellClient = nullptr; | 83 | ShellClient *m_shellClient = nullptr; | ||
97 | #if HAVE_WAYLAND_EGL | | |||
98 | wl_egl_window *m_eglWaylandWindow = nullptr; | | |||
99 | #endif | | |||
100 | quint32 m_windowId; | 84 | quint32 m_windowId; | ||
101 | const Integration *m_integration; | 85 | const Integration *m_integration; | ||
102 | int m_scale = 1; | 86 | int m_scale = 1; | ||
103 | }; | 87 | }; | ||
104 | 88 | | |||
105 | } | 89 | } | ||
106 | } | 90 | } | ||
107 | 91 | | |||
108 | #endif | 92 | #endif |