diff options
author | Jonas Yang <joyang@nvidia.com> | 2011-08-26 20:04:39 +0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-09-13 16:44:22 -0700 |
commit | 1c3d72a2291827fb15e2ef311a571c860e0dba41 (patch) | |
tree | e56949622008b0b74b681e2b16d6bacf4c2dc7fc /opengl/libs/EGL/eglApi.cpp | |
parent | ce863622ca5dd357b5e5c0a88d2e02dd00d2ab3c (diff) | |
download | frameworks_native-1c3d72a2291827fb15e2ef311a571c860e0dba41.zip frameworks_native-1c3d72a2291827fb15e2ef311a571c860e0dba41.tar.gz frameworks_native-1c3d72a2291827fb15e2ef311a571c860e0dba41.tar.bz2 |
Add (support for) EGL_NV_system_time extension.
Change-Id: I62bf0fcb5ccdc77c042b425a42054fb3122575b6
Signed-off-by: Mathias Agopian <mathias@google.com>
Diffstat (limited to 'opengl/libs/EGL/eglApi.cpp')
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 7e85230..23f67d5 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -62,6 +62,7 @@ static char const * const sExtensionString = "EGL_KHR_fence_sync " "EGL_ANDROID_image_native_buffer " "EGL_ANDROID_swap_rectangle " + "EGL_NV_system_time " ; struct extention_map_t { @@ -80,6 +81,10 @@ static const extention_map_t sExtentionMap[] = { (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR }, { "eglSetSwapRectangleANDROID", (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID }, + { "eglGetSystemTimeFrequencyNV", + (__eglMustCastToProperFunctionPointerType)&eglGetSystemTimeFrequencyNV }, + { "eglGetSystemTimeNV", + (__eglMustCastToProperFunctionPointerType)&eglGetSystemTimeNV }, }; // accesses protected by sExtensionMapMutex @@ -1454,3 +1459,46 @@ EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, } return setError(EGL_BAD_DISPLAY, NULL); } + +// ---------------------------------------------------------------------------- +// NVIDIA extensions +// ---------------------------------------------------------------------------- +EGLuint64NV eglGetSystemTimeFrequencyNV() +{ + clearError(); + + if (egl_init_drivers() == EGL_FALSE) { + return setError(EGL_BAD_PARAMETER, EGL_FALSE); + } + + EGLuint64NV ret = 0; + egl_connection_t* const cnx = &gEGLImpl[IMPL_HARDWARE]; + + if (cnx->dso) { + if (cnx->egl.eglGetSystemTimeFrequencyNV) { + return cnx->egl.eglGetSystemTimeFrequencyNV(); + } + } + + return setError(EGL_BAD_DISPLAY, 0);; +} + +EGLuint64NV eglGetSystemTimeNV() +{ + clearError(); + + if (egl_init_drivers() == EGL_FALSE) { + return setError(EGL_BAD_PARAMETER, EGL_FALSE); + } + + EGLuint64NV ret = 0; + egl_connection_t* const cnx = &gEGLImpl[IMPL_HARDWARE]; + + if (cnx->dso) { + if (cnx->egl.eglGetSystemTimeNV) { + return cnx->egl.eglGetSystemTimeNV(); + } + } + + return setError(EGL_BAD_DISPLAY, 0);; +} |