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

Commit 2b4ff836 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Conditionally expose EGL_ANDROID_get_frame_timestamps extension"

parents 00be6932 0368675d
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -322,6 +322,16 @@ EGLBoolean egl_display_t::initialize(EGLint* major, EGLint* minor) {


        mExtensionString = gBuiltinExtensionString;
        mExtensionString = gBuiltinExtensionString;


        // b/269060366 Conditionally enabled EGL_ANDROID_get_frame_timestamps extension if the
        // device's present timestamps are reliable (which may not be the case on emulators).
        if (cnx->useAngle) {
            if (android::base::GetBoolProperty("service.sf.present_timestamp", false)) {
                mExtensionString.append("EGL_ANDROID_get_frame_timestamps");
            }
        } else {
            mExtensionString.append("EGL_ANDROID_get_frame_timestamps");
        }

        hasColorSpaceSupport = findExtension(disp.queryString.extensions, "EGL_KHR_gl_colorspace");
        hasColorSpaceSupport = findExtension(disp.queryString.extensions, "EGL_KHR_gl_colorspace");


        // Note: CDD requires that devices supporting wide color and/or HDR color also support
        // Note: CDD requires that devices supporting wide color and/or HDR color also support
@@ -361,6 +371,7 @@ EGLBoolean egl_display_t::initialize(EGLint* major, EGLint* minor) {
                    findExtension(disp.queryString.extensions, "EGL_KHR_image_gl_colorspace")) {
                    findExtension(disp.queryString.extensions, "EGL_KHR_image_gl_colorspace")) {
                    mExtensionString.append("EGL_EXT_image_gl_colorspace ");
                    mExtensionString.append("EGL_EXT_image_gl_colorspace ");
                }
                }

                if (findExtension(disp.queryString.extensions, ext.c_str(), len)) {
                if (findExtension(disp.queryString.extensions, ext.c_str(), len)) {
                    mExtensionString.append(ext + " ");
                    mExtensionString.append(ext + " ");
                }
                }
+22 −1
Original line number Original line Diff line number Diff line
@@ -84,7 +84,8 @@ extern const char* const gExtensionString;
// Extensions implemented by the EGL wrapper.
// Extensions implemented by the EGL wrapper.
const char* const gBuiltinExtensionString =
const char* const gBuiltinExtensionString =
        "EGL_ANDROID_front_buffer_auto_refresh "
        "EGL_ANDROID_front_buffer_auto_refresh "
        "EGL_ANDROID_get_frame_timestamps "
        // b/269060366 Conditionally enabled during display initialization:
        //"EGL_ANDROID_get_frame_timestamps "
        "EGL_ANDROID_get_native_client_buffer "
        "EGL_ANDROID_get_native_client_buffer "
        "EGL_ANDROID_presentation_time "
        "EGL_ANDROID_presentation_time "
        "EGL_EXT_surface_CTA861_3_metadata "
        "EGL_EXT_surface_CTA861_3_metadata "
@@ -2183,6 +2184,10 @@ EGLBoolean eglGetNextFrameIdANDROIDImpl(EGLDisplay dpy, EGLSurface surface, EGLu
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }
    }


    if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) {
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }

    SurfaceRef _s(dp, surface);
    SurfaceRef _s(dp, surface);
    if (!_s.get()) {
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
@@ -2216,6 +2221,10 @@ EGLBoolean eglGetCompositorTimingANDROIDImpl(EGLDisplay dpy, EGLSurface surface,
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }
    }


    if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) {
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }

    SurfaceRef _s(dp, surface);
    SurfaceRef _s(dp, surface);
    if (!_s.get()) {
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
@@ -2270,6 +2279,10 @@ EGLBoolean eglGetCompositorTimingSupportedANDROIDImpl(EGLDisplay dpy, EGLSurface
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }
    }


    if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) {
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }

    SurfaceRef _s(dp, surface);
    SurfaceRef _s(dp, surface);
    if (!_s.get()) {
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
@@ -2300,6 +2313,10 @@ EGLBoolean eglGetFrameTimestampsANDROIDImpl(EGLDisplay dpy, EGLSurface surface,
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }
    }


    if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) {
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }

    SurfaceRef _s(dp, surface);
    SurfaceRef _s(dp, surface);
    if (!_s.get()) {
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
@@ -2385,6 +2402,10 @@ EGLBoolean eglGetFrameTimestampSupportedANDROIDImpl(EGLDisplay dpy, EGLSurface s
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }
    }


    if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) {
        return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE);
    }

    SurfaceRef _s(dp, surface);
    SurfaceRef _s(dp, surface);
    if (!_s.get()) {
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);