diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/evas/src/modules/engines/gl_x11/evas_engine.c | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-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 '')
-rw-r--r-- | libraries/evas/src/modules/engines/gl_x11/evas_engine.c | 104 |
1 files changed, 63 insertions, 41 deletions
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 | ||
608 | int _evas_engine_GL_X11_log_dom = -1; | 613 | int _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 | ||
1156 | static void | 1160 | static void |
1157 | eng_output_redraws_rect_del(void *data __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) | 1161 | eng_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 |
1247 | double | 1251 | static double |
1248 | get_time(void) | 1252 | get_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 | ||
3475 | static void | 3484 | static 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 | ||
3838 | static Eina_Bool | ||
3839 | eng_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 | |||
3829 | static void | 3850 | static void |
3830 | eng_image_max_size_get(void *data, int *maxw, int *maxh) | 3851 | eng_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); |