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

Commit

Permalink
UPSTREAM: egl: Enable eglGetPlatformDisplay on Android Platform
Browse files Browse the repository at this point in the history
This helps to add eglGetPlatformDisplay support on Android
Platform.
Reviewed-by: Eric Engestrom <[email protected]>

(cherry picked from commit 500b45a)
  • Loading branch information
renchenglei authored and strassek committed Jul 25, 2019
1 parent 80f542c commit a69fa2f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/egl/main/eglapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ _eglGetPlatformDisplayCommon(EGLenum platform, void *native_display,
case EGL_PLATFORM_SURFACELESS_MESA:
disp = _eglGetSurfacelessDisplay(native_display, attrib_list);
break;
#endif
#ifdef HAVE_ANDROID_PLATFORM
case EGL_PLATFORM_ANDROID_KHR:
disp = _eglGetAndroidDisplay(native_display, attrib_list);
break;
#endif
default:
RETURN_EGL_ERROR(NULL, EGL_BAD_PARAMETER, NULL);
Expand Down
16 changes: 16 additions & 0 deletions src/egl/main/egldisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,19 @@ _eglGetSurfacelessDisplay(void *native_display,
return _eglFindDisplay(_EGL_PLATFORM_SURFACELESS, native_display);
}
#endif /* HAVE_SURFACELESS_PLATFORM */

#ifdef HAVE_ANDROID_PLATFORM
_EGLDisplay*
_eglGetAndroidDisplay(void *native_display,
const EGLAttrib *attrib_list)
{

/* This platform recognizes no display attributes. */
if (attrib_list != NULL && attrib_list[0] != EGL_NONE) {
_eglError(EGL_BAD_ATTRIBUTE, "eglGetPlatformDisplay");
return NULL;
}

return _eglFindDisplay(_EGL_PLATFORM_ANDROID, native_display);
}
#endif /* HAVE_ANDROID_PLATFORM */
6 changes: 6 additions & 0 deletions src/egl/main/egldisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@ _eglGetSurfacelessDisplay(void *native_display,
const EGLAttrib *attrib_list);
#endif

#ifdef HAVE_ANDROID_PLATFORM
_EGLDisplay*
_eglGetAndroidDisplay(void *native_display,
const EGLAttrib *attrib_list);
#endif

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit a69fa2f

Please sign in to comment.