Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/egl_gbm_backend.h
Show All 14 Lines | |||||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 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/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_EGL_GBM_BACKEND_H | 20 | #ifndef KWIN_EGL_GBM_BACKEND_H | ||
21 | #define KWIN_EGL_GBM_BACKEND_H | 21 | #define KWIN_EGL_GBM_BACKEND_H | ||
22 | #include "abstract_egl_backend.h" | 22 | #include "abstract_egl_backend.h" | ||
23 | #include "remoteaccess_manager.h" | ||||
23 | 24 | | |||
24 | #include <memory> | 25 | #include <memory> | ||
25 | 26 | | |||
26 | struct gbm_surface; | 27 | struct gbm_surface; | ||
27 | 28 | | |||
28 | namespace KWin | 29 | namespace KWin | ||
29 | { | 30 | { | ||
30 | class DrmBackend; | 31 | class DrmBackend; | ||
Show All 23 Lines | |||||
54 | protected: | 55 | protected: | ||
55 | void present() override; | 56 | void present() override; | ||
56 | void cleanupSurfaces() override; | 57 | void cleanupSurfaces() override; | ||
57 | 58 | | |||
58 | private: | 59 | private: | ||
59 | bool initializeEgl(); | 60 | bool initializeEgl(); | ||
60 | bool initBufferConfigs(); | 61 | bool initBufferConfigs(); | ||
61 | bool initRenderingContext(); | 62 | bool initRenderingContext(); | ||
63 | void initRemotePresent(); | ||||
62 | struct Output { | 64 | struct Output { | ||
63 | DrmOutput *output = nullptr; | 65 | DrmOutput *output = nullptr; | ||
64 | DrmBuffer *buffer = nullptr; | 66 | DrmBuffer *buffer = nullptr; | ||
65 | std::shared_ptr<GbmSurface> gbmSurface; | 67 | std::shared_ptr<GbmSurface> gbmSurface; | ||
66 | EGLSurface eglSurface = EGL_NO_SURFACE; | 68 | EGLSurface eglSurface = EGL_NO_SURFACE; | ||
67 | int bufferAge = 0; | 69 | int bufferAge = 0; | ||
68 | /** | 70 | /** | ||
69 | * @brief The damage history for the past 10 frames. | 71 | * @brief The damage history for the past 10 frames. | ||
70 | */ | 72 | */ | ||
71 | QList<QRegion> damageHistory; | 73 | QList<QRegion> damageHistory; | ||
72 | }; | 74 | }; | ||
73 | bool resetOutput(Output &output, DrmOutput *drmOutput); | 75 | bool resetOutput(Output &output, DrmOutput *drmOutput); | ||
74 | bool makeContextCurrent(const Output &output); | 76 | bool makeContextCurrent(const Output &output); | ||
75 | void presentOnOutput(Output &output); | 77 | void presentOnOutput(Output &output); | ||
76 | void cleanupOutput(const Output &output); | 78 | void cleanupOutput(const Output &output); | ||
77 | void createOutput(DrmOutput *output); | 79 | void createOutput(DrmOutput *output); | ||
78 | DrmBackend *m_backend; | 80 | DrmBackend *m_backend; | ||
79 | QVector<Output> m_outputs; | 81 | QVector<Output> m_outputs; | ||
82 | QScopedPointer<RemoteAccessManager> m_remoteaccessManager; | ||||
80 | friend class EglGbmTexture; | 83 | friend class EglGbmTexture; | ||
81 | }; | 84 | }; | ||
82 | 85 | | |||
83 | /** | 86 | /** | ||
84 | * @brief Texture using an EGLImageKHR. | 87 | * @brief Texture using an EGLImageKHR. | ||
85 | **/ | 88 | **/ | ||
86 | class EglGbmTexture : public AbstractEglTexture | 89 | class EglGbmTexture : public AbstractEglTexture | ||
87 | { | 90 | { | ||
Show All 11 Lines |