aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/modules/engines/wayland_egl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/evas/src/modules/engines/wayland_egl/Makefile.am2
-rw-r--r--libraries/evas/src/modules/engines/wayland_egl/Makefile.in10
-rw-r--r--libraries/evas/src/modules/engines/wayland_egl/evas_engine.c184
-rw-r--r--libraries/evas/src/modules/engines/wayland_egl/evas_wl_main.c4
4 files changed, 30 insertions, 170 deletions
diff --git a/libraries/evas/src/modules/engines/wayland_egl/Makefile.am b/libraries/evas/src/modules/engines/wayland_egl/Makefile.am
index 100614f..9234b33 100644
--- a/libraries/evas/src/modules/engines/wayland_egl/Makefile.am
+++ b/libraries/evas/src/modules/engines/wayland_egl/Makefile.am
@@ -18,7 +18,7 @@ WAYLAND_EGL_SOURCES = \
18evas_engine.c \ 18evas_engine.c \
19evas_wl_main.c 19evas_wl_main.c
20 20
21WAYLAND_EGL_LIBADD = @FREETYPE_LIBS@ @GL_EET_LIBS@ @EINA_LIBS@ @evas_engine_wayland_egl_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la 21WAYLAND_EGL_LIBADD = @FREETYPE_LIBS@ @GL_EET_LIBS@ @EINA_LIBS@ @evas_engine_wayland_egl_libs@ @dlopen_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la
22 22
23includes_HEADERS = Evas_Engine_Wayland_Egl.h 23includes_HEADERS = Evas_Engine_Wayland_Egl.h
24includesdir = $(includedir)/evas-@VMAJ@ 24includesdir = $(includedir)/evas-@VMAJ@
diff --git a/libraries/evas/src/modules/engines/wayland_egl/Makefile.in b/libraries/evas/src/modules/engines/wayland_egl/Makefile.in
index 0df0c63..90aa36b 100644
--- a/libraries/evas/src/modules/engines/wayland_egl/Makefile.in
+++ b/libraries/evas/src/modules/engines/wayland_egl/Makefile.in
@@ -194,6 +194,8 @@ EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
194EVIL_CFLAGS = @EVIL_CFLAGS@ 194EVIL_CFLAGS = @EVIL_CFLAGS@
195EVIL_LIBS = @EVIL_LIBS@ 195EVIL_LIBS = @EVIL_LIBS@
196EXEEXT = @EXEEXT@ 196EXEEXT = @EXEEXT@
197EXOTIC_CFLAGS = @EXOTIC_CFLAGS@
198EXOTIC_LIBS = @EXOTIC_LIBS@
197FGREP = @FGREP@ 199FGREP = @FGREP@
198FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ 200FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
199FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ 201FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
@@ -244,6 +246,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
244PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ 246PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
245PIXMAN_LIBS = @PIXMAN_LIBS@ 247PIXMAN_LIBS = @PIXMAN_LIBS@
246PKG_CONFIG = @PKG_CONFIG@ 248PKG_CONFIG = @PKG_CONFIG@
249PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
250PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
247PNG_CFLAGS = @PNG_CFLAGS@ 251PNG_CFLAGS = @PNG_CFLAGS@
248PNG_LIBS = @PNG_LIBS@ 252PNG_LIBS = @PNG_LIBS@
249RANLIB = @RANLIB@ 253RANLIB = @RANLIB@
@@ -262,8 +266,6 @@ VERSION = @VERSION@
262VMAJ = @VMAJ@ 266VMAJ = @VMAJ@
263WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ 267WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@
264WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ 268WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@
265WIN32_CFLAGS = @WIN32_CFLAGS@
266WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
267XCB_CFLAGS = @XCB_CFLAGS@ 269XCB_CFLAGS = @XCB_CFLAGS@
268XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ 270XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
269XCB_GL_LIBS = @XCB_GL_LIBS@ 271XCB_GL_LIBS = @XCB_GL_LIBS@
@@ -337,8 +339,6 @@ evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
337evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ 339evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
338evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ 340evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
339evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ 341evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
340evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
341evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
342evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ 342evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
343evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ 343evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
344evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ 344evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
@@ -437,7 +437,7 @@ AM_CPPFLAGS = \
437@BUILD_ENGINE_WAYLAND_EGL_TRUE@evas_engine.c \ 437@BUILD_ENGINE_WAYLAND_EGL_TRUE@evas_engine.c \
438@BUILD_ENGINE_WAYLAND_EGL_TRUE@evas_wl_main.c 438@BUILD_ENGINE_WAYLAND_EGL_TRUE@evas_wl_main.c
439 439
440@BUILD_ENGINE_WAYLAND_EGL_TRUE@WAYLAND_EGL_LIBADD = @FREETYPE_LIBS@ @GL_EET_LIBS@ @EINA_LIBS@ @evas_engine_wayland_egl_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la 440@BUILD_ENGINE_WAYLAND_EGL_TRUE@WAYLAND_EGL_LIBADD = @FREETYPE_LIBS@ @GL_EET_LIBS@ @EINA_LIBS@ @evas_engine_wayland_egl_libs@ @dlopen_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la
441@BUILD_ENGINE_WAYLAND_EGL_TRUE@includes_HEADERS = Evas_Engine_Wayland_Egl.h 441@BUILD_ENGINE_WAYLAND_EGL_TRUE@includes_HEADERS = Evas_Engine_Wayland_Egl.h
442@BUILD_ENGINE_WAYLAND_EGL_TRUE@includesdir = $(includedir)/evas-@VMAJ@ 442@BUILD_ENGINE_WAYLAND_EGL_TRUE@includesdir = $(includedir)/evas-@VMAJ@
443@BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@pkgdir = $(libdir)/evas/modules/engines/wayland_egl/$(MODULE_ARCH) 443@BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@pkgdir = $(libdir)/evas/modules/engines/wayland_egl/$(MODULE_ARCH)
diff --git a/libraries/evas/src/modules/engines/wayland_egl/evas_engine.c b/libraries/evas/src/modules/engines/wayland_egl/evas_engine.c
index d2a6a0d..4f5102e 100644
--- a/libraries/evas/src/modules/engines/wayland_egl/evas_engine.c
+++ b/libraries/evas/src/modules/engines/wayland_egl/evas_engine.c
@@ -25,7 +25,6 @@ struct _Render_Engine
25 int end; 25 int end;
26 int w, h; 26 int w, h;
27 int vsync; 27 int vsync;
28
29}; 28};
30 29
31struct _Render_Engine_GL_Surface 30struct _Render_Engine_GL_Surface
@@ -1320,76 +1319,6 @@ struct _Native
1320// 1319//
1321//#define GLX_TEX_PIXMAP_RECREATE 1 1320//#define GLX_TEX_PIXMAP_RECREATE 1
1322 1321
1323static void
1324_native_bind_cb(void *data, void *image)
1325{
1326 Evas_GL_Image *im = image;
1327 Native *n = im->native.data;
1328
1329 if (n->egl_surface)
1330 {
1331 if (glsym_glEGLImageTargetTexture2DOES)
1332 {
1333 glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, n->egl_surface);
1334 if (eglGetError() != EGL_SUCCESS)
1335 ERR("glEGLImageTargetTexture2DOES() failed.");
1336 }
1337 else
1338 ERR("Try glEGLImageTargetTexture2DOES on EGL with no support");
1339 }
1340 return;
1341 data = NULL;
1342}
1343
1344static void
1345_native_unbind_cb(void *data, void *image)
1346{
1347 Evas_GL_Image *im = image;
1348 /* Native *n = im->native.data; */
1349
1350 /* if (n->ns.type == EVAS_NATIVE_SURFACE_X11) */
1351 /* { */
1352 /* // nothing */
1353 /* } */
1354 /* else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL) */
1355 /* { */
1356 /* glBindTexture(GL_TEXTURE_2D, 0); */
1357 /* GLERR(__FUNCTION__, __FILE__, __LINE__, ""); */
1358 /* } */
1359 return;
1360 data = NULL;
1361}
1362
1363static void
1364_native_free_cb(void *data, void *image)
1365{
1366 Render_Engine *re = data;
1367 Evas_GL_Image *im = image;
1368 Native *n = im->native.data;
1369 uint32_t texid;
1370// uint32_t pmid, texid;
1371
1372 /* eina_hash_del(re->win->gl_context->shared->native_pm_hash, &pmid, im); */
1373 if (n->egl_surface)
1374 {
1375 if (glsym_eglDestroyImage)
1376 {
1377 glsym_eglDestroyImage(re->win->egl_disp, n->egl_surface);
1378 if (eglGetError() != EGL_SUCCESS)
1379 ERR("eglDestroyImage() failed.");
1380 }
1381 else
1382 ERR("Try eglDestroyImage on EGL with no support");
1383 }
1384
1385 im->native.data = NULL;
1386 im->native.func.data = NULL;
1387 im->native.func.bind = NULL;
1388 im->native.func.unbind = NULL;
1389 im->native.func.free = NULL;
1390 free(n);
1391}
1392
1393static void * 1322static void *
1394eng_image_native_set(void *data, void *image, void *native) 1323eng_image_native_set(void *data, void *image, void *native)
1395{ 1324{
@@ -1397,10 +1326,6 @@ eng_image_native_set(void *data, void *image, void *native)
1397 Evas_Native_Surface *ns = native; 1326 Evas_Native_Surface *ns = native;
1398 Evas_GL_Image *im = image, *im2 = NULL; 1327 Evas_GL_Image *im = image, *im2 = NULL;
1399 Native *n = NULL; 1328 Native *n = NULL;
1400// uint32_t pmid;
1401// uint32_t texid;
1402 unsigned int tex = 0;
1403 unsigned int fbo = 0;
1404 1329
1405 if (!im) 1330 if (!im)
1406 { 1331 {
@@ -1418,15 +1343,7 @@ eng_image_native_set(void *data, void *image, void *native)
1418 1343
1419 if (ns) 1344 if (ns)
1420 { 1345 {
1421 /* vis = ns->data.x11.visual; */ 1346 if (im->native.data) return im;
1422 /* pm = ns->data.x11.pixmap; */
1423 if (im->native.data)
1424 {
1425 Evas_Native_Surface *ens = im->native.data;
1426 /* if ((ens->data.x11.visual == vis) && */
1427 /* (ens->data.x11.pixmap == pm)) */
1428 return im;
1429 }
1430 } 1347 }
1431 if ((!ns) && (!im->native.data)) return im; 1348 if ((!ns) && (!im->native.data)) return im;
1432 1349
@@ -1441,94 +1358,35 @@ eng_image_native_set(void *data, void *image, void *native)
1441 1358
1442 if (!ns) return im; 1359 if (!ns) return im;
1443 1360
1444 /* if (ns->type == EVAS_NATIVE_SURFACE_X11) */ 1361 if (im2 == im) return im;
1445 /* { */ 1362 if (im2)
1446 /* pmid = pm; */ 1363 {
1447 /* im2 = eina_hash_find(re->win->gl_context->shared->native_pm_hash, &pmid); */ 1364 n = im2->native.data;
1448 if (im2 == im) return im; 1365 if (n)
1449 if (im2) 1366 {
1450 { 1367 evas_gl_common_image_ref(im2);
1451 n = im2->native.data; 1368 evas_gl_common_image_free(im);
1452 if (n) 1369 return im2;
1453 { 1370 }
1454 evas_gl_common_image_ref(im2); 1371 }
1455 evas_gl_common_image_free(im);
1456 return im2;
1457 }
1458 }
1459 1372
1460 im2 = evas_gl_common_image_new_from_data(re->win->gl_context, 1373 im2 = evas_gl_common_image_new_from_data(re->win->gl_context,
1461 im->w, im->h, NULL, im->alpha, 1374 im->w, im->h, NULL, im->alpha,
1462 EVAS_COLORSPACE_ARGB8888); 1375 EVAS_COLORSPACE_ARGB8888);
1463 evas_gl_common_image_free(im); 1376 evas_gl_common_image_free(im);
1464 im = im2; 1377 im = im2;
1465 /* if (native) */ 1378
1466 /* { */
1467 /* n = calloc(1, sizeof(Native)); */
1468 /* if (n) */
1469 /* { */
1470 /* EGLConfig egl_config; */
1471 /* int config_attrs[20]; */
1472 /* int num_config, i = 0; */
1473
1474 /* eina_hash_add(re->win->gl_context->shared->native_pm_hash, &pmid, im); */
1475
1476 /* config_attrs[i++] = EGL_RED_SIZE; */
1477 /* config_attrs[i++] = 8; */
1478 /* config_attrs[i++] = EGL_GREEN_SIZE; */
1479 /* config_attrs[i++] = 8; */
1480 /* config_attrs[i++] = EGL_BLUE_SIZE; */
1481 /* config_attrs[i++] = 8; */
1482 /* config_attrs[i++] = EGL_ALPHA_SIZE; */
1483 /* config_attrs[i++] = 8; */
1484 /* config_attrs[i++] = EGL_DEPTH_SIZE; */
1485 /* config_attrs[i++] = 0; */
1486 /* config_attrs[i++] = EGL_STENCIL_SIZE; */
1487 /* config_attrs[i++] = 0; */
1488 /* config_attrs[i++] = EGL_RENDERABLE_TYPE; */
1489 /* config_attrs[i++] = EGL_OPENGL_ES2_BIT; */
1490 /* config_attrs[i++] = EGL_SURFACE_TYPE; */
1491 /* config_attrs[i++] = EGL_PIXMAP_BIT; */
1492 /* config_attrs[i++] = EGL_NONE; */
1493
1494 /* if (!eglChooseConfig(re->win->egl_disp, config_attrs, */
1495 /* &egl_config, 1, &num_config)) */
1496 /* ERR("eglChooseConfig() failed for, num_config = %i", num_config); */
1497 /* memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); */
1498 /* n->pixmap = pm; */
1499 /* if (glsym_eglCreateImage) */
1500 /* n->egl_surface = glsym_eglCreateImage(re->win->egl_disp, */
1501 /* EGL_NO_CONTEXT, */
1502 /* EGL_NATIVE_PIXMAP_KHR, */
1503 /* (void *)pm, */
1504 /* NULL); */
1505 /* else */
1506 /* ERR("Try eglCreateImage on EGL with no support"); */
1507 /* if (!n->egl_surface) */
1508 /* ERR("eglCreatePixmapSurface() for 0x%x failed", (unsigned int)pm); */
1509 /* im->native.yinvert = 1; */
1510 /* im->native.loose = 0; */
1511 /* im->native.data = n; */
1512 /* im->native.func.data = re; */
1513 /* im->native.func.bind = _native_bind_cb; */
1514 /* im->native.func.unbind = _native_unbind_cb; */
1515 /* im->native.func.free = _native_free_cb; */
1516 /* im->native.target = GL_TEXTURE_2D; */
1517 /* im->native.mipmap = 0; */
1518 /* evas_gl_common_image_native_enable(im); */
1519 /* } */
1520 /* } */
1521 return im; 1379 return im;
1522} 1380}
1523 1381
1524static void * 1382static void *
1525eng_image_native_get(void *data __UNUSED__, void *image) 1383eng_image_native_get(void *data __UNUSED__, void *image)
1526{ 1384{
1527 Evas_GL_Image *im = image; 1385 Evas_GL_Image *im;
1528 Native *n; 1386 Native *n;
1529 if (!im) return NULL; 1387
1530 n = im->native.data; 1388 if (!(im = image)) return NULL;
1531 if (!n) return NULL; 1389 if (!(n = im->native.data)) return NULL;
1532 return &(n->ns); 1390 return &(n->ns);
1533} 1391}
1534 1392
diff --git a/libraries/evas/src/modules/engines/wayland_egl/evas_wl_main.c b/libraries/evas/src/modules/engines/wayland_egl/evas_wl_main.c
index 537fcc6..60a2371 100644
--- a/libraries/evas/src/modules/engines/wayland_egl/evas_wl_main.c
+++ b/libraries/evas/src/modules/engines/wayland_egl/evas_wl_main.c
@@ -217,7 +217,9 @@ eng_window_free(Evas_GL_Wl_Window *gw)
217 { 217 {
218 if (context) eglDestroyContext(gw->egl_disp, context); 218 if (context) eglDestroyContext(gw->egl_disp, context);
219 context = EGL_NO_CONTEXT; 219 context = EGL_NO_CONTEXT;
220 eglTerminate(gw->egl_disp); 220 /* NB: This is causing an unknown hang when we run elm apps as
221 * wayland clients inside the weston compositor */
222 /* eglTerminate(gw->egl_disp); */
221 eglReleaseThread(); 223 eglReleaseThread();
222 } 224 }
223 free(gw); 225 free(gw);