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 | 23 | #include "remoteaccess_manager.h" | |||
| 24 | #include <memory> | 24 | #include <memory> | ||
| 25 | 25 | | |||
| 26 | struct gbm_surface; | 26 | struct gbm_surface; | ||
| 27 | 27 | | |||
| 28 | namespace KWin | 28 | namespace KWin | ||
| 29 | { | 29 | { | ||
| 30 | class DrmBackend; | 30 | class DrmBackend; | ||
| 31 | class DrmBuffer; | 31 | class DrmBuffer; | ||
| Show All 22 Lines | |||||
| 54 | protected: | 54 | protected: | ||
| 55 | void present() override; | 55 | void present() override; | ||
| 56 | void cleanupSurfaces() override; | 56 | void cleanupSurfaces() override; | ||
| 57 | 57 | | |||
| 58 | private: | 58 | private: | ||
| 59 | bool initializeEgl(); | 59 | bool initializeEgl(); | ||
| 60 | bool initBufferConfigs(); | 60 | bool initBufferConfigs(); | ||
| 61 | bool initRenderingContext(); | 61 | bool initRenderingContext(); | ||
| 62 | void initRemotePresent(); | ||||
| 62 | struct Output { | 63 | struct Output { | ||
| 63 | DrmOutput *output = nullptr; | 64 | DrmOutput *output = nullptr; | ||
| 64 | DrmBuffer *buffer = nullptr; | 65 | DrmBuffer *buffer = nullptr; | ||
| 65 | std::shared_ptr<GbmSurface> gbmSurface; | 66 | std::shared_ptr<GbmSurface> gbmSurface; | ||
| 66 | EGLSurface eglSurface = EGL_NO_SURFACE; | 67 | EGLSurface eglSurface = EGL_NO_SURFACE; | ||
| 67 | int bufferAge = 0; | 68 | int bufferAge = 0; | ||
| 68 | /** | 69 | /** | ||
| 69 | * @brief The damage history for the past 10 frames. | 70 | * @brief The damage history for the past 10 frames. | ||
| 70 | */ | 71 | */ | ||
| 71 | QList<QRegion> damageHistory; | 72 | QList<QRegion> damageHistory; | ||
| 72 | }; | 73 | }; | ||
| 73 | bool resetOutput(Output &output, DrmOutput *drmOutput); | 74 | bool resetOutput(Output &output, DrmOutput *drmOutput); | ||
| 74 | bool makeContextCurrent(const Output &output); | 75 | bool makeContextCurrent(const Output &output); | ||
| 75 | void presentOnOutput(Output &output); | 76 | void presentOnOutput(Output &output); | ||
| 76 | void cleanupOutput(const Output &output); | 77 | void cleanupOutput(const Output &output); | ||
| 77 | void createOutput(DrmOutput *output); | 78 | void createOutput(DrmOutput *output); | ||
| 78 | DrmBackend *m_backend; | 79 | DrmBackend *m_backend; | ||
| 79 | QVector<Output> m_outputs; | 80 | QVector<Output> m_outputs; | ||
| 81 | QScopedPointer<RemoteAccessManager> m_remoteaccessManager; | ||||
| 80 | friend class EglGbmTexture; | 82 | friend class EglGbmTexture; | ||
| 81 | }; | 83 | }; | ||
| 82 | 84 | | |||
| 83 | /** | 85 | /** | ||
| 84 | * @brief Texture using an EGLImageKHR. | 86 | * @brief Texture using an EGLImageKHR. | ||
| 85 | **/ | 87 | **/ | ||
| 86 | class EglGbmTexture : public AbstractEglTexture | 88 | class EglGbmTexture : public AbstractEglTexture | ||
| 87 | { | 89 | { | ||
| Show All 11 Lines | |||||