summaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
authorrenchenglei <[email protected]>2019-06-28 15:21:08 +0800
committerEric Engestrom <[email protected]>2019-06-29 12:20:17 +0100
commit500b45a98a6183ff8ab7bae77e0a750a3cd45adc (patch)
treedca160e353dcba53ad4c85813f19449cb1896b94 /src/egl/main
parent02c6cd8481f466b8dd4769f9e9af3744fcc1ce1a (diff)
egl: Enable eglGetPlatformDisplay on Android Platform
This helps to add eglGetPlatformDisplay support on Android Platform. Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/eglapi.c5
-rw-r--r--src/egl/main/egldisplay.c16
-rw-r--r--src/egl/main/egldisplay.h6
3 files changed, 27 insertions, 0 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index cffa756365e..7c9d2c92a0f 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -406,6 +406,11 @@ _eglGetPlatformDisplayCommon(EGLenum platform, void *native_display,
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
case EGL_PLATFORM_DEVICE_EXT:
disp = _eglGetDeviceDisplay(native_display, attrib_list);
break;
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index acb0405822f..193443e056c 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -568,6 +568,22 @@ _eglGetSurfacelessDisplay(void *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,
+ attrib_list);
+}
+#endif /* HAVE_ANDROID_PLATFORM */
_EGLDisplay*
_eglGetDeviceDisplay(void *native_display,
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index f73ff99fbee..02ac4fb9a9d 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -315,6 +315,12 @@ _eglGetSurfacelessDisplay(void *native_display,
const EGLAttrib *attrib_list);
#endif
+#ifdef HAVE_ANDROID_PLATFORM
+_EGLDisplay*
+_eglGetAndroidDisplay(void *native_display,
+ const EGLAttrib *attrib_list);
+#endif
+
_EGLDisplay*
_eglGetDeviceDisplay(void *native_display,
const EGLAttrib *attrib_list);