aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/modules/engines/gl_x11
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-23 23:30:42 +1000
committerDavid Walter Seikel2012-01-23 23:30:42 +1000
commit825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch)
tree75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/evas/src/modules/engines/gl_x11
parentAdd ability to disable the test harness, or the Lua compile test. (diff)
downloadSledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip
SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz
SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2
SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to 'libraries/evas/src/modules/engines/gl_x11')
-rw-r--r--libraries/evas/src/modules/engines/gl_x11/Makefile.in8
-rw-r--r--libraries/evas/src/modules/engines/gl_x11/evas_engine.c104
-rw-r--r--libraries/evas/src/modules/engines/gl_x11/evas_x_main.c2
3 files changed, 70 insertions, 44 deletions
diff --git a/libraries/evas/src/modules/engines/gl_x11/Makefile.in b/libraries/evas/src/modules/engines/gl_x11/Makefile.in
index f589e61..ad4944e 100644
--- a/libraries/evas/src/modules/engines/gl_x11/Makefile.in
+++ b/libraries/evas/src/modules/engines/gl_x11/Makefile.in
@@ -242,8 +242,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
242PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 242PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
243PIXMAN_LIBS = @PIXMAN_LIBS@ 243PIXMAN_LIBS = @PIXMAN_LIBS@
244PKG_CONFIG = @PKG_CONFIG@ 244PKG_CONFIG = @PKG_CONFIG@
245PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
246PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
247PNG_CFLAGS = @PNG_CFLAGS@ 245PNG_CFLAGS = @PNG_CFLAGS@
248PNG_LIBS = @PNG_LIBS@ 246PNG_LIBS = @PNG_LIBS@
249RANLIB = @RANLIB@ 247RANLIB = @RANLIB@
@@ -260,6 +258,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
260VALGRIND_LIBS = @VALGRIND_LIBS@ 258VALGRIND_LIBS = @VALGRIND_LIBS@
261VERSION = @VERSION@ 259VERSION = @VERSION@
262VMAJ = @VMAJ@ 260VMAJ = @VMAJ@
261WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
262WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
263WIN32_CFLAGS = @WIN32_CFLAGS@ 263WIN32_CFLAGS = @WIN32_CFLAGS@
264WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ 264WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
265XCB_CFLAGS = @XCB_CFLAGS@ 265XCB_CFLAGS = @XCB_CFLAGS@
@@ -341,6 +341,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
341evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ 341evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
342evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ 342evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
343evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ 343evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
344evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@
345evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@
346evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@
347evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@
344evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ 348evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
345evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ 349evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
346evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ 350evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
diff --git a/libraries/evas/src/modules/engines/gl_x11/evas_engine.c b/libraries/evas/src/modules/engines/gl_x11/evas_engine.c
index 38e0c13..fbbd1a2 100644
--- a/libraries/evas/src/modules/engines/gl_x11/evas_engine.c
+++ b/libraries/evas/src/modules/engines/gl_x11/evas_engine.c
@@ -584,25 +584,30 @@ _extensions_init(Render_Engine *re)
584 584
585#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) 585#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
586 // EGL Extensions 586 // EGL Extensions
587 evasglexts = glsym_eglQueryString(re->win->egl_disp, EGL_EXTENSIONS); 587 if (glsym_eglQueryString)
588 {
589 evasglexts = glsym_eglQueryString(re->win->egl_disp, EGL_EXTENSIONS);
588#else 590#else
589 evasglexts = glXQueryExtensionsString(re->info->info.display, 591 if (glsym_glXQueryExtensionsString)
590 re->info->info.screen); 592 {
593 evasglexts = glXQueryExtensionsString(re->info->info.display,
594 re->info->info.screen);
591#endif 595#endif
592 596
593 DBG("--------EvasGL Extensions----------"); 597 DBG("--------EvasGL Extensions----------");
594 for (i = 0; _evasgl_ext_entries[i].name != NULL; i++) 598 for (i = 0; _evasgl_ext_entries[i].name != NULL; i++)
595 {
596 if ( (strstr(evasglexts, _evasgl_ext_entries[i].name) != NULL) ||
597 (strstr(evasglexts, _evasgl_ext_entries[i].real_name) != NULL) )
598 { 599 {
599 _evasgl_ext_entries[i].supported = 1; 600 if ( (strstr(evasglexts, _evasgl_ext_entries[i].name) != NULL) ||
600 strcat(_evasgl_ext_string, _evasgl_ext_entries[i].name); 601 (strstr(evasglexts, _evasgl_ext_entries[i].real_name) != NULL) )
601 strcat(_evasgl_ext_string, " "); 602 {
602 DBG("\t%s", _evasgl_ext_entries[i].name); 603 _evasgl_ext_entries[i].supported = 1;
604 strcat(_evasgl_ext_string, _evasgl_ext_entries[i].name);
605 strcat(_evasgl_ext_string, " ");
606 DBG("\t%s", _evasgl_ext_entries[i].name);
607 }
603 } 608 }
609 DBG(" ");
604 } 610 }
605 DBG(" ");
606} 611}
607 612
608int _evas_engine_GL_X11_log_dom = -1; 613int _evas_engine_GL_X11_log_dom = -1;
@@ -1125,12 +1130,12 @@ eng_output_redraws_rect_add(void *data, int x, int y, int w, int h)
1125 eng_window_use(re->win); 1130 eng_window_use(re->win);
1126 evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot); 1131 evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot);
1127 evas_common_tilebuf_add_redraw(re->tb, x, y, w, h); 1132 evas_common_tilebuf_add_redraw(re->tb, x, y, w, h);
1128/* 1133
1129 RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, re->win->w, re->win->h); 1134 RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, re->win->w, re->win->h);
1130 if ((w <= 0) || (h <= 0)) return; 1135 if ((w <= 0) || (h <= 0)) return;
1131 if (!re->win->draw.redraw) 1136 if (!re->win->draw.redraw)
1132 { 1137 {
1133#if 0 1138#if 1
1134 re->win->draw.x1 = x; 1139 re->win->draw.x1 = x;
1135 re->win->draw.y1 = y; 1140 re->win->draw.y1 = y;
1136 re->win->draw.x2 = x + w - 1; 1141 re->win->draw.x2 = x + w - 1;
@@ -1150,11 +1155,10 @@ eng_output_redraws_rect_add(void *data, int x, int y, int w, int h)
1150 if ((y + h - 1) > re->win->draw.y2) re->win->draw.y2 = y + h - 1; 1155 if ((y + h - 1) > re->win->draw.y2) re->win->draw.y2 = y + h - 1;
1151 } 1156 }
1152 re->win->draw.redraw = 1; 1157 re->win->draw.redraw = 1;
1153 */
1154} 1158}
1155 1159
1156static void 1160static void
1157eng_output_redraws_rect_del(void *data __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) 1161eng_output_redraws_rect_del(void *data, int x, int y, int w, int h)
1158{ 1162{
1159 Render_Engine *re; 1163 Render_Engine *re;
1160 1164
@@ -1244,10 +1248,10 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
1244//#define FRAMECOUNT 1 1248//#define FRAMECOUNT 1
1245 1249
1246#ifdef FRAMECOUNT 1250#ifdef FRAMECOUNT
1247double 1251static double
1248get_time(void) 1252get_time(void)
1249{ 1253{
1250 struct timeval timev; 1254 struct timeval timev;
1251 1255
1252 gettimeofday(&timev, NULL); 1256 gettimeofday(&timev, NULL);
1253 return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); 1257 return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
@@ -1391,44 +1395,46 @@ eng_output_flush(void *data)
1391 { 1395 {
1392 re->info->callback.pre_swap(re->info->callback.data, re->evas); 1396 re->info->callback.pre_swap(re->info->callback.data, re->evas);
1393 } 1397 }
1394/* 1398#if 1
1395 if ((1) 1399 if (1)
1396// (re->win->draw.x1 == 0) && 1400#else
1397// (re->win->draw.y1 == 0) && 1401 if ((re->win->draw.x1 == 0) && (re->win->draw.y1 == 0) && (re->win->draw.x2 == (re->win->w - 1)) && (re->win->draw.y2 == (re->win->h - 1)))
1398// (re->win->draw.x2 == (re->win->w - 1)) && 1402#endif
1399// (re->win->draw.y2 == (re->win->h - 1))
1400 )
1401 */
1402 { 1403 {
1404// double t, t2 = 0.0;
1405// t = get_time();
1403 glXSwapBuffers(re->win->disp, re->win->win); 1406 glXSwapBuffers(re->win->disp, re->win->win);
1404 if (!safe_native) glXWaitGL(); 1407// t = get_time() - t;
1408// if (!safe_native)
1409// {
1410// t2 = get_time();
1411// glXWaitGL();
1412// t2 = get_time() - t2;
1413// }
1414// printf("swap: %3.5f (%3.5fms), x wait gl: %3.5f (%3.5fms)\n",
1415// t, t * 1000.0, t2, t2 * 1000.0);
1405 } 1416 }
1406/*
1407 else 1417 else
1408 { 1418 {
1409// FIXME: this doesn't work.. why oh why? 1419// FIXME: this doesn't work.. why oh why?
1410 int sx, sy, sw, sh; 1420 int sx, sy, sw, sh;
1411 1421
1412 // fimxe - reset when done
1413// glEnable(GL_SCISSOR_TEST);
1414 glDrawBuffer(GL_FRONT);
1415
1416 sx = re->win->draw.x1; 1422 sx = re->win->draw.x1;
1417 sy = re->win->draw.y1; 1423 sy = re->win->draw.y1;
1418 sw = (re->win->draw.x2 - re->win->draw.x1) + 1; 1424 sw = (re->win->draw.x2 - re->win->draw.x1) + 1;
1419 sh = (re->win->draw.y2 - re->win->draw.y1) + 1; 1425 sh = (re->win->draw.y2 - re->win->draw.y1) + 1;
1420 sy = re->win->h - sy - sh; 1426 sy = re->win->h - sy - sh;
1421 1427
1422// glScissor(sx, sy, sw, sh); 1428 glBitmap(0, 0, 0, 0, sx, re->win->h - sy, NULL);
1423 glRasterPos2i(sx, re->win->h - sy); 1429 glEnable(GL_SCISSOR_TEST);
1430 glScissor(sx, sy, sw, sh);
1431 glDrawBuffer(GL_FRONT);
1424 glCopyPixels(sx, sy, sw, sh, GL_COLOR); 1432 glCopyPixels(sx, sy, sw, sh, GL_COLOR);
1425 glRasterPos2i(0, 0);
1426
1427// glDisable(GL_SCISSOR_TEST);
1428 glDrawBuffer(GL_BACK); 1433 glDrawBuffer(GL_BACK);
1434 glDisable(GL_SCISSOR_TEST);
1435 glBitmap(0, 0, 0, 0, 0, 0, NULL);
1429 glFlush(); 1436 glFlush();
1430 } 1437 }
1431 */
1432 if (re->info->callback.post_swap) 1438 if (re->info->callback.post_swap)
1433 { 1439 {
1434 re->info->callback.post_swap(re->info->callback.data, re->evas); 1440 re->info->callback.post_swap(re->info->callback.data, re->evas);
@@ -3469,7 +3475,10 @@ evgl_evasglCreateImage(int target, void* buffer, int *attrib_list)
3469 attrib_list); 3475 attrib_list);
3470 } 3476 }
3471 else 3477 else
3472 ERR("Invalid Engine... (Can't acccess EGL Display)\n"); 3478 {
3479 ERR("Invalid Engine... (Can't acccess EGL Display)\n");
3480 return NULL;
3481 }
3473} 3482}
3474 3483
3475static void 3484static void
@@ -3826,6 +3835,18 @@ eng_image_animated_frame_set(void *data __UNUSED__, void *image, int frame_index
3826 return EINA_TRUE; 3835 return EINA_TRUE;
3827} 3836}
3828 3837
3838static Eina_Bool
3839eng_image_can_region_get(void *data __UNUSED__, void *image)
3840{
3841 Evas_GL_Image *gim = image;
3842 Image_Entry *im;
3843 if (!gim) return EINA_FALSE;
3844 im = (Image_Entry *)gim->im;
3845 if (!im) return EINA_FALSE;
3846 return ((Evas_Image_Load_Func*) im->info.loader)->do_region;
3847}
3848
3849
3829static void 3850static void
3830eng_image_max_size_get(void *data, int *maxw, int *maxh) 3851eng_image_max_size_get(void *data, int *maxw, int *maxh)
3831{ 3852{
@@ -3903,6 +3924,7 @@ module_open(Evas_Module *em)
3903 ORD(image_format_get); 3924 ORD(image_format_get);
3904 ORD(image_colorspace_set); 3925 ORD(image_colorspace_set);
3905 ORD(image_colorspace_get); 3926 ORD(image_colorspace_get);
3927 ORD(image_can_region_get);
3906 ORD(image_mask_create); 3928 ORD(image_mask_create);
3907 ORD(image_native_set); 3929 ORD(image_native_set);
3908 ORD(image_native_get); 3930 ORD(image_native_get);
diff --git a/libraries/evas/src/modules/engines/gl_x11/evas_x_main.c b/libraries/evas/src/modules/engines/gl_x11/evas_x_main.c
index 323c976..c29ab67 100644
--- a/libraries/evas/src/modules/engines/gl_x11/evas_x_main.c
+++ b/libraries/evas/src/modules/engines/gl_x11/evas_x_main.c
@@ -531,13 +531,13 @@ eng_window_free(Evas_GL_X11_Window *gw)
531#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) 531#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
532 if (gw->egl_surface[0] != EGL_NO_SURFACE) 532 if (gw->egl_surface[0] != EGL_NO_SURFACE)
533 eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); 533 eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
534 eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
534 if (ref == 0) 535 if (ref == 0)
535 { 536 {
536 if (context) eglDestroyContext(gw->egl_disp, context); 537 if (context) eglDestroyContext(gw->egl_disp, context);
537 eglTerminate(gw->egl_disp); 538 eglTerminate(gw->egl_disp);
538 context = EGL_NO_CONTEXT; 539 context = EGL_NO_CONTEXT;
539 } 540 }
540 eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
541#else 541#else
542 if (gw->glxwin) glXDestroyWindow(gw->disp, gw->glxwin); 542 if (gw->glxwin) glXDestroyWindow(gw->disp, gw->glxwin);
543 if (ref == 0) 543 if (ref == 0)