Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e17f69b5 authored by Ben Lin's avatar Ben Lin
Browse files

Fallback to eglGetDisplay if platform display n/a for Android platform.

It is possible that eglGetPlatformDisplay implementation exists, but it
does not work for the case where the platform is Android (One such
example is mesa). One last fallback to eglGetDisplay.

Bug: 118503773
Test: None
Change-Id: I9c39db7b42058544186191141e2a0261b99a8716
parent 6894160b
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -265,7 +265,12 @@ EGLDisplay egl_display_t::getPlatformDisplay(EGLNativeDisplayType display,
            if (cnx->egl.eglGetPlatformDisplay) {
            if (cnx->egl.eglGetPlatformDisplay) {
                dpy = cnx->egl.eglGetPlatformDisplay(EGL_PLATFORM_ANDROID_KHR, display,
                dpy = cnx->egl.eglGetPlatformDisplay(EGL_PLATFORM_ANDROID_KHR, display,
                                                     attrib_list);
                                                     attrib_list);
            } else {
            }

            // It is possible that eglGetPlatformDisplay does not have a
            // working implementation for Android platform; in that case,
            // one last fallback to eglGetDisplay
            if(dpy == EGL_NO_DISPLAY) {
                if (attrib_list) {
                if (attrib_list) {
                    ALOGW("getPlatformDisplay: unexpected attribute list, attributes ignored");
                    ALOGW("getPlatformDisplay: unexpected attribute list, attributes ignored");
                }
                }