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

Commit 150cb095 authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter
Browse files

Android doesn't support Pixmaps

When adding the EGL 1.5 functions we have eglCreatePlatformPixmapSurface
return an error because Android doesn't support pixmaps.
Modify the eglCreatePixmapSurface to match to keep things consistent.

Test: cts-tradefed run commandAndExit cts -m CtsDeqpTestCases --module-arg 'CtsDeqpTestCases:include-filter:dEQP-EGL.*'
Bug: 80297325
Change-Id: Ic597598d2d8cea603d05730d8411bed88ce80431
(cherry picked from commit f465a57aef7c486e564d05aa4c7f6f5ee55f3fe0)
parent 40627ba8
Loading
Loading
Loading
Loading
+3 −26
Original line number Diff line number Diff line
@@ -863,35 +863,12 @@ EGLSurface eglCreatePlatformPixmapSurfaceImpl(EGLDisplay dpy, EGLConfig /*config
    return EGL_NO_SURFACE;
}

EGLSurface eglCreatePixmapSurfaceImpl(  EGLDisplay dpy, EGLConfig config,
                                        NativePixmapType pixmap,
                                        const EGLint *attrib_list)
{
EGLSurface eglCreatePixmapSurfaceImpl(EGLDisplay dpy, EGLConfig /*config*/,
                                      NativePixmapType /*pixmap*/, const EGLint* /*attrib_list*/) {
    egl_connection_t* cnx = nullptr;
    egl_display_ptr dp = validate_display_connection(dpy, cnx);
    if (dp) {
        EGLDisplay iDpy = dp->disp.dpy;
        android_pixel_format format;
        getNativePixelFormat(iDpy, cnx, config, &format);

        // now select a corresponding sRGB format if needed
        EGLint colorSpace = EGL_UNKNOWN;
        std::vector<EGLint> strippedAttribList;
        if (!processAttributes(dp, nullptr, format, attrib_list, &colorSpace,
                               &strippedAttribList)) {
            ALOGE("error invalid colorspace: %d", colorSpace);
            return setError(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
        }
        attrib_list = strippedAttribList.data();

        EGLSurface surface = cnx->egl.eglCreatePixmapSurface(
                dp->disp.dpy, config, pixmap, attrib_list);
        if (surface != EGL_NO_SURFACE) {
            egl_surface_t* s =
                    new egl_surface_t(dp.get(), config, nullptr, surface,
                                      getReportedColorSpace(colorSpace), cnx);
            return s;
        }
        return setError(EGL_BAD_PARAMETER, EGL_NO_SURFACE);
    }
    return EGL_NO_SURFACE;
}