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

Commit 7284145d authored by Andy McFadden's avatar Andy McFadden
Browse files

Add eglPresentationTimeANDROID

Added EGL extension to set a timestamp on a surface.

Also, fix JNI encoding of "long" in glgen.

Bug 8191230

Change-Id: I38b7334bade3f8ff02bffe600bb74469ef22c164
parent 306f18c5
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -311,6 +311,18 @@ typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCANDROID) (EGLDisplay dpy, EGLSyncKHR
#define EGL_FRAMEBUFFER_TARGET_ANDROID                0x3147
#define EGL_FRAMEBUFFER_TARGET_ANDROID                0x3147
#endif
#endif


/* EGL_ANDROID_presentation_time
 */
#ifndef EGL_ANDROID_presentation_time
#define EGL_ANDROID_presentation_time 1
typedef khronos_stime_nanoseconds_t EGLnsecsANDROID;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean eglPresentationTimeANDROID(EGLDisplay dpy, EGLSurface sur, EGLnsecsANDROID time);
#else
typedef EGLBoolean (EGLAPIENTRYP PFNEGLPRESENTATIONTIMEANDROID) (EGLDisplay dpy, EGLSurface sur, EGLnsecsANDROID time);
#endif
#endif

#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
+22 −0
Original line number Original line Diff line number Diff line
@@ -1307,6 +1307,28 @@ EGLint eglWaitSyncANDROID(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags)
    return result;
    return result;
}
}


EGLBoolean eglPresentationTimeANDROID(EGLDisplay dpy, EGLSurface surface,
        EGLnsecsANDROID time)
{
    clearError();

    const egl_display_ptr dp = validate_display(dpy);
    if (!dp) {
        return EGL_FALSE;
    }

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

    egl_surface_t const * const s = get_surface(surface);
    native_window_set_buffers_timestamp(s->win.get(), time);

    return EGL_TRUE;
}

// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// NVIDIA extensions
// NVIDIA extensions
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
+1 −0
Original line number Original line Diff line number Diff line
@@ -31,3 +31,4 @@ EGLBoolean eglWaitGL ( void )
EGLBoolean eglWaitNative ( EGLint engine )
EGLBoolean eglWaitNative ( EGLint engine )
EGLBoolean eglSwapBuffers ( EGLDisplay dpy, EGLSurface surface )
EGLBoolean eglSwapBuffers ( EGLDisplay dpy, EGLSurface surface )
EGLBoolean eglCopyBuffers ( EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target )
EGLBoolean eglCopyBuffers ( EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target )
EGLBoolean eglPresentationTimeANDROID ( EGLDisplay dpy, EGLSurface sur, EGLnsecsANDROID time )
+1 −0
Original line number Original line Diff line number Diff line
@@ -56,6 +56,7 @@ public class JType {
    typeMapping.put(new CType("EGLNativeWindowType"), new JType("int"));
    typeMapping.put(new CType("EGLNativeWindowType"), new JType("int"));
    typeMapping.put(new CType("EGLNativeDisplayType"), new JType("int"));
    typeMapping.put(new CType("EGLNativeDisplayType"), new JType("int"));
    typeMapping.put(new CType("EGLClientBuffer"), new JType("int"));
    typeMapping.put(new CType("EGLClientBuffer"), new JType("int"));
    typeMapping.put(new CType("EGLnsecsANDROID"), new JType("long"));


    // EGL nonprimitive types
    // EGL nonprimitive types
    typeMapping.put(new CType("EGLConfig"), new JType("EGLConfig", true, false));
    typeMapping.put(new CType("EGLConfig"), new JType("EGLConfig", true, false));
+1 −1
Original line number Original line Diff line number Diff line
@@ -54,7 +54,7 @@ public class JniCodeEmitter {
        } else if (baseType.equals("short")) {
        } else if (baseType.equals("short")) {
            jniName += "S";
            jniName += "S";
        } else if (baseType.equals("long")) {
        } else if (baseType.equals("long")) {
            jniName += "L";
            jniName += "J";
        } else if (baseType.equals("byte")) {
        } else if (baseType.equals("byte")) {
            jniName += "B";
            jniName += "B";
        } else if (baseType.equals("String")) {
        } else if (baseType.equals("String")) {