From d8378306613c816ba7de60cf1706dd9f183542b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 18 Aug 2015 08:40:35 +0200 Subject: [PATCH] [wayland] AbstractBackend announces whether a surface less context is possible In an own QPA plugin we want to make the OpenGL context sharing with our compositing context and bypass the windowing system for OpenGL windows. In order to achieve this we need a surfaceless context. The AbstractBackend now forwards whether such a context can be created on the EGLDisplay used by the Compositor. --- abstract_backend.cpp | 5 +++++ abstract_backend.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/abstract_backend.cpp b/abstract_backend.cpp index bdded1f75b..a8b7881c4a 100644 --- a/abstract_backend.cpp +++ b/abstract_backend.cpp @@ -305,6 +305,11 @@ void AbstractBackend::warpPointer(const QPointF &globalPos) Q_UNUSED(globalPos) } +bool AbstractBackend::supportsQpaContext() const +{ + return hasGLExtension(QByteArrayLiteral("EGL_KHR_surfaceless_context")); +} + EGLDisplay AbstractBackend::sceneEglDisplay() const { if (Compositor *c = Compositor::self()) { diff --git a/abstract_backend.h b/abstract_backend.h index bb93f783d8..a6586d93ed 100644 --- a/abstract_backend.h +++ b/abstract_backend.h @@ -46,6 +46,11 @@ public: virtual OpenGLBackend *createOpenGLBackend(); virtual QPainterBackend *createQPainterBackend(); virtual void warpPointer(const QPointF &globalPos); + /** + * Whether our Compositing EGL display allows a surface less context + * so that a sharing context could be created. + **/ + virtual bool supportsQpaContext() const; /** * The EGLDisplay used by the compositing scene. **/