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

Commit 5fc5bc2f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove temporary EGL mitigations for Android P."

parents 187f1c0a 30c1d90f
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -1712,31 +1712,13 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
    ContextRef _c(dp.get(), ctx);
    egl_context_t * const c = _c.get();

    // Temporary hack: eglImageCreateKHR should accept EGL_GL_COLORSPACE_LINEAR_KHR,
    // EGL_GL_COLORSPACE_SRGB_KHR and EGL_GL_COLORSPACE_DEFAULT_EXT if
    // EGL_EXT_image_gl_colorspace is supported, but some drivers don't like
    // the DEFAULT value and generate an error.
    std::vector<EGLint> strippedAttribList;
    for (const EGLint *attr = attrib_list; attr && attr[0] != EGL_NONE; attr += 2) {
        if (attr[0] == EGL_GL_COLORSPACE_KHR &&
            dp->haveExtension("EGL_EXT_image_gl_colorspace")) {
            if (attr[1] != EGL_GL_COLORSPACE_LINEAR_KHR &&
                attr[1] != EGL_GL_COLORSPACE_SRGB_KHR) {
                continue;
            }
        }
        strippedAttribList.push_back(attr[0]);
        strippedAttribList.push_back(attr[1]);
    }
    strippedAttribList.push_back(EGL_NONE);

    EGLImageKHR result = EGL_NO_IMAGE_KHR;
    egl_connection_t* const cnx = &gEGLImpl;
    if (cnx->dso && cnx->egl.eglCreateImageKHR) {
        result = cnx->egl.eglCreateImageKHR(
                dp->disp.dpy,
                c ? c->context : EGL_NO_CONTEXT,
                target, buffer, strippedAttribList.data());
                target, buffer, attrib_list);
    }
    return result;
}
+0 −6
Original line number Diff line number Diff line
@@ -240,12 +240,6 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) {
            if (len) {
                // NOTE: we could avoid the copy if we had strnstr.
                const std::string ext(start, len);
                // Temporary hack: Adreno 530 driver exposes this extension under the draft
                // KHR name, but during Khronos review it was decided to demote it to EXT.
                if (ext == "EGL_EXT_image_gl_colorspace" &&
                    findExtension(disp.queryString.extensions, "EGL_KHR_image_gl_colorspace")) {
                    mExtensionString.append("EGL_EXT_image_gl_colorspace ");
                }
                if (findExtension(disp.queryString.extensions, ext.c_str(), len)) {
                    mExtensionString.append(ext + " ");
                }