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

Commit 8ff83bc2 authored by Yuxin Hu's avatar Yuxin Hu Committed by Android (Google) Code Review
Browse files

Merge "Conditionally expose EGL_ANDROID_get_frame_timestamps extension" into udc-dev

parents 0d6449cf 7fee4411
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -322,6 +322,16 @@ EGLBoolean egl_display_t::initialize(EGLint* major, EGLint* minor) {

        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");

        // 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")) {
                    mExtensionString.append("EGL_EXT_image_gl_colorspace ");
                }

                if (findExtension(disp.queryString.extensions, ext.c_str(), len)) {
                    mExtensionString.append(ext + " ");
                }
+22 −1
Original line number Diff line number Diff line
@@ -84,7 +84,8 @@ extern const char* const gExtensionString;
// Extensions implemented by the EGL wrapper.
const char* const gBuiltinExtensionString =
        "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_presentation_time "
        "EGL_EXT_surface_CTA861_3_metadata "
@@ -2185,6 +2186,10 @@ EGLBoolean eglGetNextFrameIdANDROIDImpl(EGLDisplay dpy, EGLSurface surface, EGLu
        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);
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
@@ -2218,6 +2223,10 @@ EGLBoolean eglGetCompositorTimingANDROIDImpl(EGLDisplay dpy, EGLSurface surface,
        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);
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
@@ -2272,6 +2281,10 @@ EGLBoolean eglGetCompositorTimingSupportedANDROIDImpl(EGLDisplay dpy, EGLSurface
        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);
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
@@ -2302,6 +2315,10 @@ EGLBoolean eglGetFrameTimestampsANDROIDImpl(EGLDisplay dpy, EGLSurface surface,
        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);
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
@@ -2387,6 +2404,10 @@ EGLBoolean eglGetFrameTimestampSupportedANDROIDImpl(EGLDisplay dpy, EGLSurface s
        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);
    if (!_s.get()) {
        return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);