Commit graph

8 commits

Author SHA1 Message Date
Martin Gräßlin
44843f462f [plugins/qpa] Support SharingPlatformContext on the existing eglSurface and eglconfig
Summary:
So far SharingPlatformContext was only used if the OpenGL context
supports EGL_KHR_surfaceless_context. If not supported, KWin tried to
create a context through the Wayland API. Unfortunately on hwcomposer
platform this results in a crash as libhybris only supports the init
of EGLDisplay for one native platform.

This change tries to also use the SharingPlatformContext if there is
an OpenGL context in general. It reuses the native EGLSurface created
for the compositing scene and makes its own OpenGL context current on
that surface, too. As KWin creates an FBO, it never renders to it, so
it shouldn't matter at all.

In order to prevent EGL_BAD_MATCH errors when making Qt's OpenGL context
current also the EGLConfig from the scene is used to create the context.

Test Plan: Tested on Nexus5 with qtvirtualkeyboard in KWin

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2231
2016-07-20 14:17:11 +02:00
Martin Gräßlin
5dcaad7fe8 [plugins/qpa] Add debug output in configFromGLFormat
We might need to know what kind of EGLConfig Qt wants.
2016-07-19 08:13:22 +02:00
Martin Gräßlin
dce3ea6a20 [plugins/qpa] Add debug output for the KWin internal QPA plugin
Reviewed-By: bshah
2016-07-18 16:34:03 +02:00
Martin Gräßlin
7d08b08470 [plugins/qpa] Adjust to changes in Qt 5.7 QPA interface
BUG: 360269
2016-03-09 17:15:15 +01:00
Martin Gräßlin
b383db2e2e Create robust egl context if possible 2015-11-16 09:08:14 +01:00
Martin Gräßlin
f2ad98aa3a Add O2ES as possible value for KWIN_COMPOSE
If KWIN_COMPOSE is set to O2ES, an OpenGL ES context is tried to
be created instead of an OpenGL context.

REVIEW: 125919
2015-11-03 09:30:12 +01:00
Martin Gräßlin
2f065b9c6b [plugins/qpa] Runtime depend on OpenGLES instead of compile time
Using QOpenGLContext::openGLModuleType() to determine whether we
need a GLES or GL context.
2015-11-03 09:29:31 +01:00
Martin Gräßlin
26b3569a0b [wayland] Add a QPA plugin for kwin_wayland
This introduces an own QPA plugin for KWin. QtWayland's plugin is not
a good solution for KWin as QtWayland is meant for Wayland clients and
not for a Wayland server. Given that it makes more sense to have a very
minimal QPA plugin which supports the use cases we actually have.

With our own QPA plugin we should be able to improve the following
areas:
* no need to create Wayland server before QApplication
* Qt::BypassWindowManagerHint can be supported
* no workaround for creating OpenGL context in main thread
* sharing OpenGL context with Qt
* OpenGL context for Qt on libhybris backend

The plugin supports so far the following features:
* creating a QPlatformWindow using KWayland::Client (ShellSurface)
* creating a QPlatformBackingStore using a ShmPool
* creating a QPlatformOpenGLContext with Wayland::EGL
* or creating a QPlatformOpenGLContext which shares with KWin's scene
* creating a QPlatformScreen for each KWayland::Client::Output
* QPlatformNativeInterface compatible to QtWayland
2015-08-25 14:33:50 +02:00