Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit a69fa2f

Browse files
renchengleistrassek
authored andcommitted
UPSTREAM: egl: Enable eglGetPlatformDisplay on Android Platform
This helps to add eglGetPlatformDisplay support on Android Platform. Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (cherry picked from commit 500b45a)
1 parent 80f542c commit a69fa2f

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

src/egl/main/eglapi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,11 @@ _eglGetPlatformDisplayCommon(EGLenum platform, void *native_display,
411411
case EGL_PLATFORM_SURFACELESS_MESA:
412412
disp = _eglGetSurfacelessDisplay(native_display, attrib_list);
413413
break;
414+
#endif
415+
#ifdef HAVE_ANDROID_PLATFORM
416+
case EGL_PLATFORM_ANDROID_KHR:
417+
disp = _eglGetAndroidDisplay(native_display, attrib_list);
418+
break;
414419
#endif
415420
default:
416421
RETURN_EGL_ERROR(NULL, EGL_BAD_PARAMETER, NULL);

src/egl/main/egldisplay.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,3 +542,19 @@ _eglGetSurfacelessDisplay(void *native_display,
542542
return _eglFindDisplay(_EGL_PLATFORM_SURFACELESS, native_display);
543543
}
544544
#endif /* HAVE_SURFACELESS_PLATFORM */
545+
546+
#ifdef HAVE_ANDROID_PLATFORM
547+
_EGLDisplay*
548+
_eglGetAndroidDisplay(void *native_display,
549+
const EGLAttrib *attrib_list)
550+
{
551+
552+
/* This platform recognizes no display attributes. */
553+
if (attrib_list != NULL && attrib_list[0] != EGL_NONE) {
554+
_eglError(EGL_BAD_ATTRIBUTE, "eglGetPlatformDisplay");
555+
return NULL;
556+
}
557+
558+
return _eglFindDisplay(_EGL_PLATFORM_ANDROID, native_display);
559+
}
560+
#endif /* HAVE_ANDROID_PLATFORM */

src/egl/main/egldisplay.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,12 @@ _eglGetSurfacelessDisplay(void *native_display,
301301
const EGLAttrib *attrib_list);
302302
#endif
303303

304+
#ifdef HAVE_ANDROID_PLATFORM
305+
_EGLDisplay*
306+
_eglGetAndroidDisplay(void *native_display,
307+
const EGLAttrib *attrib_list);
308+
#endif
309+
304310
#ifdef __cplusplus
305311
}
306312
#endif

0 commit comments

Comments
 (0)