Diffusion KWin 44843f462f54

[plugins/qpa] Support SharingPlatformContext on the existing eglSurface and…

Authored by graesslin on Jul 18 2016, 9:17 AM.

Description

[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