Skip to content
  • Martin Flöser's avatar
    [plugins/qpa] Support SharingPlatformContext on the existing eglSurface and eglconfig · 44843f46
    Martin Flöser authored
    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...
    44843f46