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

Commit 4873103e authored by Pablo Ceballos's avatar Pablo Ceballos Committed by Android (Google) Code Review
Browse files

Merge "jni: Regenerated EGL/GLES JNI files to support null arguments"

parents e2703bee 6aff9068
Loading
Loading
Loading
Loading
+135 −163
Original line number Diff line number Diff line
@@ -184,12 +184,7 @@ android_eglInitialize
    jint _minorRemaining;
    EGLint *minor = (EGLint *) 0;

    if (!major_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "major == null";
        goto exit;
    }
    if (major_ref) {
        if (majorOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -206,13 +201,9 @@ android_eglInitialize
        major_base = (EGLint *)
            _env->GetIntArrayElements(major_ref, (jboolean *)0);
        major = major_base + majorOffset;

    if (!minor_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "minor == null";
        goto exit;
    }

    if (minor_ref) {
        if (minorOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -229,6 +220,7 @@ android_eglInitialize
        minor_base = (EGLint *)
            _env->GetIntArrayElements(minor_ref, (jboolean *)0);
        minor = minor_base + minorOffset;
    }

    _returnValue = eglInitialize(
        (EGLDisplay)dpy_native,
@@ -289,12 +281,7 @@ android_eglGetConfigs
    jint _num_configRemaining;
    EGLint *num_config = (EGLint *) 0;

    if (!configs_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "configs == null";
        goto exit;
    }
    if (configs_ref) {
        if (configsOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -309,6 +296,7 @@ android_eglGetConfigs
            goto exit;
        }
        configs = new EGLConfig[_configsRemaining];
    }

    if (!num_config_ref) {
        _exception = 1;
@@ -401,12 +389,7 @@ android_eglChooseConfig
        goto exit;
    }

    if (!configs_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "configs == null";
        goto exit;
    }
    if (configs_ref) {
        if (configsOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -421,6 +404,7 @@ android_eglChooseConfig
            goto exit;
        }
        configs = new EGLConfig[_configsRemaining];
    }

    if (!num_config_ref) {
        _exception = 1;
@@ -546,31 +530,13 @@ android_eglCreateWindowSurface
    EGLint *attrib_list = (EGLint *) 0;
    android::sp<ANativeWindow> window;

    if (!attrib_list_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "attrib_list == null";
        goto exit;
    }
    if (attrib_list_ref) {
        if (offset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
            _exceptionMessage = "offset < 0";
            goto exit;
        }
    if (win == NULL) {
not_valid_surface:
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "Make sure the SurfaceView or associated SurfaceHolder has a valid Surface";
        goto exit;
    }

    window = android::android_view_Surface_getNativeWindow(_env, win);

    if (window == NULL)
        goto not_valid_surface;

        _remaining = _env->GetArrayLength(attrib_list_ref) - offset;
        attrib_list_base = (EGLint *)
            _env->GetIntArrayElements(attrib_list_ref, (jboolean *)0);
@@ -588,6 +554,20 @@ not_valid_surface:
            _exceptionMessage = "attrib_list must contain EGL_NONE!";
            goto exit;
        }
    }

    if (win == NULL) {
not_valid_surface:
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "Make sure the SurfaceView or associated SurfaceHolder has a valid Surface";
        goto exit;
    }

    window = android::android_view_Surface_getNativeWindow(_env, win);

    if (window == NULL)
        goto not_valid_surface;

    _returnValue = eglCreateWindowSurface(
        (EGLDisplay)dpy_native,
@@ -703,12 +683,7 @@ android_eglCreatePbufferSurface
    jint _remaining;
    EGLint *attrib_list = (EGLint *) 0;

    if (!attrib_list_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "attrib_list == null";
        goto exit;
    }
    if (attrib_list_ref) {
        if (offset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -732,6 +707,7 @@ android_eglCreatePbufferSurface
            _exceptionMessage = "attrib_list must contain EGL_NONE!";
            goto exit;
        }
    }

    _returnValue = eglCreatePbufferSurface(
        (EGLDisplay)dpy_native,
@@ -882,12 +858,7 @@ android_eglCreatePbufferFromClientBuffer
    jint _remaining;
    EGLint *attrib_list = (EGLint *) 0;

    if (!attrib_list_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "attrib_list == null";
        goto exit;
    }
    if (attrib_list_ref) {
        if (offset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -911,6 +882,7 @@ android_eglCreatePbufferFromClientBuffer
            _exceptionMessage = "attrib_list must contain EGL_NONE!";
            goto exit;
        }
    }

    _returnValue = eglCreatePbufferFromClientBuffer(
        (EGLDisplay)dpy_native,
+57 −75
Original line number Diff line number Diff line
@@ -1783,12 +1783,7 @@ android_glGetActiveAttrib__III_3II_3II_3II_3BI
    jint _nameRemaining;
    char *name = (char *) 0;

    if (!length_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "length == null";
        goto exit;
    }
    if (length_ref) {
        if (lengthOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -1799,6 +1794,7 @@ android_glGetActiveAttrib__III_3II_3II_3II_3BI
        length_base = (GLsizei *)
            _env->GetIntArrayElements(length_ref, (jboolean *)0);
        length = length_base + lengthOffset;
    }

    if (!size_ref) {
        _exception = 1;
@@ -2111,12 +2107,7 @@ android_glGetActiveUniform__III_3II_3II_3II_3BI
    jint _nameRemaining;
    char *name = (char *) 0;

    if (!length_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "length == null";
        goto exit;
    }
    if (length_ref) {
        if (lengthOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -2127,6 +2118,7 @@ android_glGetActiveUniform__III_3II_3II_3II_3BI
        length_base = (GLsizei *)
            _env->GetIntArrayElements(length_ref, (jboolean *)0);
        length = length_base + lengthOffset;
    }

    if (!size_ref) {
        _exception = 1;
@@ -2434,12 +2426,7 @@ android_glGetAttachedShaders__II_3II_3II
    jint _shadersRemaining;
    GLuint *shaders = (GLuint *) 0;

    if (!count_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "count == null";
        goto exit;
    }
    if (count_ref) {
        if (countOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -2456,6 +2443,7 @@ android_glGetAttachedShaders__II_3II_3II
        count_base = (GLsizei *)
            _env->GetIntArrayElements(count_ref, (jboolean *)0);
        count = count_base + countOffset;
    }

    if (!shaders_ref) {
        _exception = 1;
@@ -2526,7 +2514,6 @@ android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
            goto exit;
        }
    }
    if (shaders_buf) {
    shaders = (GLuint *)getPointer(_env, shaders_buf, (jarray*)&_shadersArray, &_shadersRemaining, &_shadersBufferOffset);
    if (_shadersRemaining < maxcount) {
        _exception = 1;
@@ -2534,12 +2521,11 @@ android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
        _exceptionMessage = "remaining() < maxcount < needed";
        goto exit;
    }
    }
    if (count_buf && count == NULL) {
        char * _countBase = (char *)_env->GetIntArrayElements(_countArray, (jboolean *) 0);
        count = (GLsizei *) (_countBase + _countBufferOffset);
    }
    if (shaders_buf && shaders == NULL) {
    if (shaders == NULL) {
        char * _shadersBase = (char *)_env->GetIntArrayElements(_shadersArray, (jboolean *) 0);
        shaders = (GLuint *) (_shadersBase + _shadersBufferOffset);
    }
@@ -3262,12 +3248,7 @@ android_glGetShaderSource__II_3II_3BI
    jint _sourceRemaining;
    char *source = (char *) 0;

    if (!length_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "length == null";
        goto exit;
    }
    if (length_ref) {
        if (lengthOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -3278,6 +3259,7 @@ android_glGetShaderSource__II_3II_3BI
        length_base = (GLsizei *)
            _env->GetIntArrayElements(length_ref, (jboolean *)0);
        length = length_base + lengthOffset;
    }

    if (!source_ref) {
        _exception = 1;
+56 −66
Original line number Diff line number Diff line
@@ -501,8 +501,10 @@ android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2
    jint _remaining;
    GLvoid *pixels = (GLvoid *) 0;

    if (pixels_buf) {
        pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
    if (pixels == NULL) {
    }
    if (pixels_buf && pixels == NULL) {
        char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
        pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
    }
@@ -1910,12 +1912,7 @@ android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI
    jint _nameRemaining;
    char *name = (char *) 0;

    if (!length_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "length == null";
        goto exit;
    }
    if (length_ref) {
        if (lengthOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -1926,6 +1923,7 @@ android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI
        length_base = (GLsizei *)
            _env->GetIntArrayElements(length_ref, (jboolean *)0);
        length = length_base + lengthOffset;
    }

    if (!size_ref) {
        _exception = 1;
@@ -3591,12 +3589,7 @@ android_glGetActiveUniformBlockName_III_3II_3BI
    jint _nameRemaining;
    GLchar* _name = (GLchar*)0;

    if (!length_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "length == null";
        goto exit;
    }
    if (length_ref) {
        if (lengthOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -3607,6 +3600,7 @@ android_glGetActiveUniformBlockName_III_3II_3BI
        _length_base = (GLsizei*)_env->GetIntArrayElements(
                length_ref, (jboolean*)0);
        _length = _length_base + lengthOffset;
    }

    if (!name_ref) {
        _exception = 1;
@@ -3900,12 +3894,7 @@ android_glGetSynciv__JII_3II_3II
    jint _valuesRemaining;
    GLint *values = (GLint *) 0;

    if (!length_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "length == null";
        goto exit;
    }
    if (length_ref) {
        if (lengthOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -3916,6 +3905,7 @@ android_glGetSynciv__JII_3II_3II
        length_base = (GLsizei *)
            _env->GetIntArrayElements(length_ref, (jboolean *)0);
        length = length_base + lengthOffset;
    }

    if (!values_ref) {
        _exception = 1;
@@ -3969,9 +3959,11 @@ android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
    jint _valuesRemaining;
    GLint *values = (GLint *) 0;

    if (length_buf) {
        length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
    }
    values = (GLint *)getPointer(_env, values_buf, (jarray*)&_valuesArray, &_valuesRemaining, &_valuesBufferOffset);
    if (length == NULL) {
    if (length_buf && length == NULL) {
        char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
        length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
    }
@@ -4772,12 +4764,7 @@ android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2
    jint _binaryRemaining;
    GLvoid *binary = (GLvoid *) 0;

    if (!length_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "length == null";
        goto exit;
    }
    if (length_ref) {
        if (lengthOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -4788,6 +4775,7 @@ android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2
        length_base = (GLsizei *)
            _env->GetIntArrayElements(length_ref, (jboolean *)0);
        length = length_base + lengthOffset;
    }

    if (!binaryFormat_ref) {
        _exception = 1;
@@ -4853,10 +4841,12 @@ android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_ni
    jint _binaryRemaining;
    GLvoid *binary = (GLvoid *) 0;

    if (length_buf) {
        length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
    }
    binaryFormat = (GLenum *)getPointer(_env, binaryFormat_buf, (jarray*)&_binaryFormatArray, &_binaryFormatRemaining, &_binaryFormatBufferOffset);
    binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
    if (length == NULL) {
    if (length_buf && length == NULL) {
        char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
        length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
    }
+15 −17
Original line number Diff line number Diff line
@@ -714,12 +714,7 @@ android_glGetProgramResourceiv__IIII_3III_3II_3II
        _env->GetIntArrayElements(props_ref, (jboolean *)0);
    props = props_base + propsOffset;

    if (!length_ref) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "length == null";
        goto exit;
    }
    if (length_ref) {
        if (lengthOffset < 0) {
            _exception = 1;
            _exceptionType = "java/lang/IllegalArgumentException";
@@ -730,6 +725,7 @@ android_glGetProgramResourceiv__IIII_3III_3II_3II
        length_base = (GLsizei *)
            _env->GetIntArrayElements(length_ref, (jboolean *)0);
        length = length_base + lengthOffset;
    }

    if (!params_ref) {
        _exception = 1;
@@ -795,13 +791,15 @@ android_glGetProgramResourceiv__IIIILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2L
    GLint *params = (GLint *) 0;

    props = (GLenum *)getPointer(_env, props_buf, (jarray*)&_propsArray, &_propsRemaining, &_propsBufferOffset);
    if (length_buf) {
        length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
    }
    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_paramsArray, &_paramsRemaining, &_paramsBufferOffset);
    if (props == NULL) {
        char * _propsBase = (char *)_env->GetIntArrayElements(_propsArray, (jboolean *) 0);
        props = (GLenum *) (_propsBase + _propsBufferOffset);
    }
    if (length == NULL) {
    if (length_buf && length == NULL) {
        char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
        length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
    }
+2 −8
Original line number Diff line number Diff line
@@ -646,13 +646,9 @@ android_glObjectLabelKHR__IIILjava_lang_String_2
    const char * _exceptionMessage = NULL;
    const char* _nativelabel = 0;

    if (!label) {
        _exception = 1;
        _exceptionType = "java/lang/IllegalArgumentException";
        _exceptionMessage = "label == null";
        goto exit;
    }
    if (label) {
        _nativelabel = _env->GetStringUTFChars(label, 0);
    }

    glObjectLabelKHR(
        (GLenum)identifier,
@@ -660,8 +656,6 @@ android_glObjectLabelKHR__IIILjava_lang_String_2
        (GLsizei)length,
        (GLchar *)_nativelabel
    );

exit:
    if (_nativelabel) {
        _env->ReleaseStringUTFChars(label, _nativelabel);
    }