Add cogl_get_clock_time()

Add an API to get the current time in the time system that Cogl
is reporting timestamps. This is to be used to convert timestamps
into a different time system.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 9f3735a0c37adcfcffa485f81699b53a4cc0caf8)
This commit is contained in:
Owen W. Taylor
2013-01-28 12:22:57 -05:00
committed by Robert Bragg
parent d12f39d0e6
commit 98e3b57d0d
4 changed files with 75 additions and 0 deletions

View File

@ -756,4 +756,16 @@ _cogl_context_get_gl_version (CoglContext *context)
return _cogl_config_override_gl_version;
else
return (const char *) context->glGetString (GL_VERSION);
}
int64_t
cogl_get_clock_time (CoglContext *context)
{
const CoglWinsysVtable *winsys = _cogl_context_get_winsys (context);
if (winsys->context_get_clock_time)
return winsys->context_get_clock_time (context);
else
return 0;
}