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

Commit b1d6b733 authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter
Browse files

EGL 1.5 cleanup eglGetPlatformDisplay

Generation scripts cannot create code for eglGetPlatformDisplay,
(prior CL modified code by hand after generation)
this change removes the need for generating code for that function.
Also include eglCreateImage and eglDestroyImage in EGL15.spec file.

Bug: 80297325
Test: atest CtsGraphicsTestCases:EGL15Test
Change-Id: I18e2f8fe43a43e6f74f4687af28c656dd9f65bc0
parent eb606b26
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -10,3 +10,5 @@ EGLDisplay eglGetPlatformDisplay ( EGLenum platform, EGLAttrib native_display, c
EGLSurface eglCreatePlatformWindowSurface ( EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list )
EGLSurface eglCreatePlatformPixmapSurface ( EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list )
EGLBoolean eglWaitSync ( EGLDisplay dpy, EGLSync sync, EGLint flags )
EGLImage eglCreateImage ( EGLDisplay dpy, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list )
EGLBoolean eglDestroyImage ( EGLDisplay dpy, EGLImage image )
+2 −0
Original line number Diff line number Diff line
@@ -11,3 +11,5 @@ eglQuerySurface check value 1
//STUB function: eglCreatePbufferFromClientBuffer nullAllowed attrib_list sentinel attrib_list EGL_NONE
eglCreateContext sentinel attrib_list EGL_NONE
eglQueryContext check value 1
//unsupported: eglCreatePlatformPixmapSurface nullAllowed attrib_list sentinel attrib_list EGL_NONE
eglCreatePlatformPixmapSurface unsupported
+46 −0
Original line number Diff line number Diff line
/* EGLDisplay eglGetPlatformDisplay ( EGLenum platform, EGLAttrib native_display, const EGLAttrib *attrib_list ) */
static jobject
android_eglGetPlatformDisplay
  (JNIEnv *_env, jobject _this, jint platform, jlong native_display, jlongArray attrib_list_ref, jint offset) {
    jint _exception = 0;
    const char * _exceptionType = NULL;
    const char * _exceptionMessage = NULL;
    EGLDisplay _returnValue = (EGLDisplay) 0;
    EGLAttrib *attrib_list_base = (EGLAttrib *) 0;
    jint _remaining;
    EGLAttrib *attrib_list = (EGLAttrib *) 0;

    if (!attrib_list_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "attrib_list == null";
        goto exit;
    }
    if (offset < 0) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "offset < 0";
        goto exit;
    }
    _remaining = _env->GetArrayLength(attrib_list_ref) - offset;
    attrib_list_base = (EGLAttrib *)
        _env->GetLongArrayElements(attrib_list_ref, (jboolean *)0);
    attrib_list = attrib_list_base + offset;

    _returnValue = eglGetPlatformDisplay(
        (EGLenum)platform,
        (void *)native_display,
        (EGLAttrib *)attrib_list
    );

exit:
    if (attrib_list_base) {
        _env->ReleaseLongArrayElements(attrib_list_ref, (jlong*)attrib_list_base,
            JNI_ABORT);
    }
    if (_exception) {
        jniThrowException(_env, _exceptionType, _exceptionMessage);
    }
    return toEGLHandle(_env, egldisplayClass, egldisplayConstructor, _returnValue);
}
+9 −0
Original line number Diff line number Diff line
    // C function EGLDisplay eglGetPlatformDisplay ( EGLenum platform, EGLAttrib native_display, const EGLAttrib *attrib_list )

    public static native EGLDisplay eglGetPlatformDisplay(
        int platform,
        long native_display,
        long[] attrib_list,
        int offset
    );
+1 −0
Original line number Diff line number Diff line
{"eglGetPlatformDisplay", "(IJ[JI)Landroid/opengl/EGLDisplay;", (void *) android_eglGetPlatformDisplay },