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

Authored by graesslin on Jul 20 2016, 5:53 AM.

Details

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

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 5342.Jul 20 2016, 5:53 AM
graesslin retitled this revision from to [plugins/qpa] Support SharingPlatformContext on the existing eglSurface and eglconfig.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptJul 20 2016, 5:53 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
bshah accepted this revision.Jul 20 2016, 11:03 AM
bshah added a reviewer: bshah.
bshah added a subscriber: bshah.

Tested and works...

This revision is now accepted and ready to land.Jul 20 2016, 11:03 AM
This revision was automatically updated to reflect the committed changes.