egl/android: Provide an option for the backend to expose KHR_image
authorHarish Krupo <harish.krupo.kps@intel.com>
Fri, 8 Dec 2017 15:59:39 +0000 (21:29 +0530)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 14 Dec 2017 11:43:03 +0000 (13:43 +0200)
From android cts 8.0_r4, a new test case checks if all the required egl
extensions are exposed. In the current implementation we expose KHR_image
if KHR_image_base and KHR_image_pixmap are supported but KHR_image spec
does not mandate the existence of both the extensions.
This patch preserves the current check and also provides the backend
with an option to expose the KHR_image extension.

Test: run cts -m CtsOpenGLTestCases -t \
android.opengl.cts.OpenGlEsVersionTest#testRequiredEglExtensions

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/platform_android.c
src/egl/main/eglapi.c
src/egl/main/egldisplay.h

index 2320fb6f214968cd090e75e4d5f1c41b525889ae..7cf03b3467f285e3611747d2391426a140c8c308 100644 (file)
@@ -1249,6 +1249,7 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy)
 #if ANDROID_API_LEVEL >= 23
    dpy->Extensions.KHR_partial_update = EGL_TRUE;
 #endif
+   dpy->Extensions.KHR_image = EGL_TRUE;
 
    /* Fill vtbl last to prevent accidentally calling virtual function during
     * initialization.
index cec67425e13e018477bbc6874aed6155743bc25a..5110688f2d10e3b5e0e5b7fd19f05cd2036811f5 100644 (file)
@@ -504,7 +504,8 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
    _EGL_CHECK_EXTENSION(KHR_gl_texture_3D_image);
    _EGL_CHECK_EXTENSION(KHR_gl_texture_cubemap_image);
    if (dpy->Extensions.KHR_image_base && dpy->Extensions.KHR_image_pixmap)
-      _eglAppendExtension(&exts, "EGL_KHR_image");
+      dpy->Extensions.KHR_image = EGL_TRUE;
+   _EGL_CHECK_EXTENSION(KHR_image);
    _EGL_CHECK_EXTENSION(KHR_image_base);
    _EGL_CHECK_EXTENSION(KHR_image_pixmap);
    _EGL_CHECK_EXTENSION(KHR_no_config_context);
index 52fb4ce21bb7923824536400c1893c793ded68ed..0005c81836d45c917326591b3b097b4e55f40867 100644 (file)
@@ -122,6 +122,7 @@ struct _egl_extensions
    EGLBoolean KHR_gl_texture_2D_image;
    EGLBoolean KHR_gl_texture_3D_image;
    EGLBoolean KHR_gl_texture_cubemap_image;
+   EGLBoolean KHR_image;
    EGLBoolean KHR_image_base;
    EGLBoolean KHR_image_pixmap;
    EGLBoolean KHR_no_config_context;