From 115b62634b8a8225b7e4e98406b31adc5460c948 Mon Sep 17 00:00:00 2001 From: raster Date: Wed, 31 Mar 2010 09:25:21 +0000 Subject: [PATCH] some debugging i get to turn on sometimes... off now. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@47618 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/modules/engines/gl_x11/evas_engine.c | 36 +++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/modules/engines/gl_x11/evas_engine.c b/src/modules/engines/gl_x11/evas_engine.c index ad61126..96210a6 100644 --- a/src/modules/engines/gl_x11/evas_engine.c +++ b/src/modules/engines/gl_x11/evas_engine.c @@ -410,11 +410,28 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i return re->win->gl_context->def_surface; } +//#define FRAMECOUNT 1 + +#ifdef FRAMECOUNT +double +get_time(void) +{ + struct timeval timev; + + gettimeofday(&timev, NULL); + return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); +} +#endif + static void eng_output_redraws_next_update_push(void *data, void *surface __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) { Render_Engine *re; - +#ifdef FRAMECOUNT + static double pt = 0.0; + double ta, tb; +#endif + re = (Render_Engine *)data; /* put back update surface.. in this case just unflag redraw */ re->win->draw.redraw = 0; @@ -423,7 +440,17 @@ eng_output_redraws_next_update_push(void *data, void *surface __UNUSED__, int x #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) // this is needed to make sure all previous rendering is flushed to // buffers/surfaces +#ifdef FRAMECOUNT + double t0 = get_time(); + ta = t0 - pt; + pt = t0; +#endif eglWaitNative(EGL_CORE_NATIVE_ENGINE); // previous rendering should be done and swapped +#ifdef FRAMECOUNT + double t1 = get_time(); + tb = t1 - t0; + printf("... %1.5f -> %1.5f | ", ta, tb); +#endif // if (eglGetError() != EGL_SUCCESS) // { // printf("Error: eglWaitNative(EGL_CORE_NATIVE_ENGINE) fail.\n"); @@ -446,7 +473,14 @@ eng_output_flush(void *data) eng_window_use(re->win); #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) +#ifdef FRAMECOUNT + double t0 = get_time(); +#endif eglSwapBuffers(re->win->egl_disp, re->win->egl_surface[0]); +#ifdef FRAMECOUNT + double t1 = get_time(); + printf("%1.5f\n", t1 - t0); +#endif // if (eglGetError() != EGL_SUCCESS) // { // printf("Error: eglSwapBuffers() fail.\n"); -- 2.7.4