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

Commit f04f4cd6 authored by Jack Palevich's avatar Jack Palevich Committed by Android (Google) Code Review
Browse files

Merge "Implement eglInitialize / eglTerminate reference counting"

parents 66abb729 81cd0844
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -650,6 +650,7 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
    if (dp->refs > 0) {
    if (dp->refs > 0) {
        if (major != NULL) *major = VERSION_MAJOR;
        if (major != NULL) *major = VERSION_MAJOR;
        if (minor != NULL) *minor = VERSION_MINOR;
        if (minor != NULL) *minor = VERSION_MINOR;
        dp->refs++;
        return EGL_TRUE;
        return EGL_TRUE;
    }
    }
    
    
@@ -755,8 +756,10 @@ EGLBoolean eglTerminate(EGLDisplay dpy)
    }
    }


    // this is specific to Android, display termination is ref-counted.
    // this is specific to Android, display termination is ref-counted.
    if (dp->refs > 1)
    if (dp->refs > 1) {
        dp->refs--;
        return EGL_TRUE;
        return EGL_TRUE;
    }


    EGLBoolean res = EGL_FALSE;
    EGLBoolean res = EGL_FALSE;
    for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) {
    for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) {