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

Commit 15f50dbe authored by Ian Elliott's avatar Ian Elliott Committed by Po-Chien Hsueh
Browse files

Remove a no-longer-needed workaround from eglMakeCurrent

Change Ids I857da78078dd212b523d690415cf525ecd463961 and
I38f3450005a4eec5f1a684ee7d66363e88f6d92f added/refined a work-around
for a buggy driver (that's no longer supported), and introduced a
problem by swallowing eglMakeCurrent errors coming from the driver.
This change removes the work-around, as the original author reported
that it is no longer needed.

Bug: 71505290
Bug: 111963599
Test: Build and install
Change-Id: I0121edfa076667e3320ae2c3b95608c3482937a7
Merged-Id: I0121edfa076667e3320ae2c3b95608c3482937a7
(cherry picked from commit 60d35a21)
(cherry picked from commit 97eba519)
parent 036335d2
Loading
Loading
Loading
Loading
+0 −32
Original line number Diff line number Diff line
@@ -1054,38 +1054,6 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
            egl_tls_t::setContext(EGL_NO_CONTEXT);
        }
    } else {

        if (cur_c != NULL) {
            // Force return to current context for drivers that cannot handle errors
            EGLBoolean restore_result = EGL_FALSE;
            // get a reference to the old current objects
            ContextRef _c2(dp.get(), cur_c);
            SurfaceRef _d2(dp.get(), cur_c->draw);
            SurfaceRef _r2(dp.get(), cur_c->read);

            c = cur_c;
            impl_ctx = c->context;
            impl_draw = EGL_NO_SURFACE;
            if (cur_c->draw != EGL_NO_SURFACE) {
                d = get_surface(cur_c->draw);
                impl_draw = d->surface;
            }
            impl_read = EGL_NO_SURFACE;
            if (cur_c->read != EGL_NO_SURFACE) {
                r = get_surface(cur_c->read);
                impl_read = r->surface;
            }
            restore_result = dp->makeCurrent(c, cur_c,
                    cur_c->draw, cur_c->read, cur_c->context,
                    impl_draw, impl_read, impl_ctx);
            if (restore_result == EGL_TRUE) {
                _c2.acquire();
                _r2.acquire();
                _d2.acquire();
            } else {
                ALOGE("Could not restore original EGL context");
            }
        }
        // this will ALOGE the error
        egl_connection_t* const cnx = &gEGLImpl;
        result = setError(cnx->egl.eglGetError(), (EGLBoolean)EGL_FALSE);