summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:52:03 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:52:03 -0700
commitcc4d41c89001ecc449cdfa5d631ffae8aacd8a9c (patch)
treef79fd281b41630d8917f3781298f66237ee477cf /src/modules
parent39d4e343b0ab8ef93c1240454fba75c287e64a07 (diff)
evas: make image_native_set use engine context not output.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c109
1 files changed, 55 insertions, 54 deletions
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 0a9a69c..45675ec 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -2286,8 +2286,8 @@ eng_image_native_shutdown(void *engine EINA_UNUSED, Evas_Native_Surface_Type typ
2286static void * 2286static void *
2287eng_image_native_set(void *engine, void *image, void *native) 2287eng_image_native_set(void *engine, void *image, void *native)
2288{ 2288{
2289 Render_Engine *re = (Render_Engine *)engine;
2290 const Evas_Native_Surface *ns = native; 2289 const Evas_Native_Surface *ns = native;
2290 Evas_Engine_GL_Context *gl_context;
2291 Evas_GL_Image *im = image, *im2 = NULL; 2291 Evas_GL_Image *im = image, *im2 = NULL;
2292 Visual *vis = NULL; 2292 Visual *vis = NULL;
2293 Pixmap pm = 0; 2293 Pixmap pm = 0;
@@ -2296,17 +2296,20 @@ eng_image_native_set(void *engine, void *image, void *native)
2296 unsigned int tex = 0; 2296 unsigned int tex = 0;
2297 unsigned int fbo = 0; 2297 unsigned int fbo = 0;
2298 void *buffer = NULL; 2298 void *buffer = NULL;
2299 Outbuf *ob;
2299#ifdef GL_GLES 2300#ifdef GL_GLES
2300# ifdef HAVE_WAYLAND 2301# ifdef HAVE_WAYLAND
2301 void *wlid, *wl_buf = NULL; 2302 void *wlid, *wl_buf = NULL;
2302# endif 2303# endif
2303#endif 2304#endif
2304 2305
2306 gl_context = gl_generic_context_find(engine);
2307 ob = gl_generic_any_output_get(engine);
2305 if (!im) 2308 if (!im)
2306 { 2309 {
2307 if ((ns) && (ns->type == EVAS_NATIVE_SURFACE_OPENGL)) 2310 if ((ns) && (ns->type == EVAS_NATIVE_SURFACE_OPENGL))
2308 { 2311 {
2309 im = glsym_evas_gl_common_image_new_from_data(eng_get_ob(re)->gl_context, 2312 im = glsym_evas_gl_common_image_new_from_data(gl_context,
2310 ns->data.opengl.w, 2313 ns->data.opengl.w,
2311 ns->data.opengl.h, 2314 ns->data.opengl.h,
2312 NULL, 1, 2315 NULL, 1,
@@ -2381,8 +2384,6 @@ eng_image_native_set(void *engine, void *image, void *native)
2381 } 2384 }
2382 if ((!ns) && (!im->native.data)) return im; 2385 if ((!ns) && (!im->native.data)) return im;
2383 2386
2384 eng_window_use(eng_get_ob(re));
2385
2386 if (im->native.data) 2387 if (im->native.data)
2387 { 2388 {
2388 if (im->native.func.free) 2389 if (im->native.func.free)
@@ -2395,7 +2396,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2395 if (ns->type == EVAS_NATIVE_SURFACE_X11) 2396 if (ns->type == EVAS_NATIVE_SURFACE_X11)
2396 { 2397 {
2397 pmid = pm; 2398 pmid = pm;
2398 im2 = eina_hash_find(eng_get_ob(re)->gl_context->shared->native_pm_hash, &pmid); 2399 im2 = eina_hash_find(gl_context->shared->native_pm_hash, &pmid);
2399 if (im2 == im) return im; 2400 if (im2 == im) return im;
2400 if (im2) 2401 if (im2)
2401 { 2402 {
@@ -2411,7 +2412,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2411 else if (ns->type == EVAS_NATIVE_SURFACE_OPENGL) 2412 else if (ns->type == EVAS_NATIVE_SURFACE_OPENGL)
2412 { 2413 {
2413 texid = tex; 2414 texid = tex;
2414 im2 = eina_hash_find(eng_get_ob(re)->gl_context->shared->native_tex_hash, &texid); 2415 im2 = eina_hash_find(gl_context->shared->native_tex_hash, &texid);
2415 if (im2 == im) return im; 2416 if (im2 == im) return im;
2416 if (im2) 2417 if (im2)
2417 { 2418 {
@@ -2426,7 +2427,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2426 } 2427 }
2427 else if (ns->type == EVAS_NATIVE_SURFACE_TBM) 2428 else if (ns->type == EVAS_NATIVE_SURFACE_TBM)
2428 { 2429 {
2429 im2 = eina_hash_find(eng_get_ob(re)->gl_context->shared->native_tbm_hash, &buffer); 2430 im2 = eina_hash_find(gl_context->shared->native_tbm_hash, &buffer);
2430 if (im2 == im) return im; 2431 if (im2 == im) return im;
2431 if (im2) 2432 if (im2)
2432 { 2433 {
@@ -2441,7 +2442,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2441 } 2442 }
2442 else if (ns->type == EVAS_NATIVE_SURFACE_EVASGL) 2443 else if (ns->type == EVAS_NATIVE_SURFACE_EVASGL)
2443 { 2444 {
2444 im2 = eina_hash_find(eng_get_ob(re)->gl_context->shared->native_evasgl_hash, &buffer); 2445 im2 = eina_hash_find(gl_context->shared->native_evasgl_hash, &buffer);
2445 if (im2 == im) return im; 2446 if (im2 == im) return im;
2446 if (im2) 2447 if (im2)
2447 { 2448 {
@@ -2459,7 +2460,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2459#ifdef GL_GLES 2460#ifdef GL_GLES
2460# ifdef HAVE_WAYLAND 2461# ifdef HAVE_WAYLAND
2461 wlid = wl_buf; 2462 wlid = wl_buf;
2462 im2 = eina_hash_find(eng_get_ob(re)->gl_context->shared->native_wl_hash, &wlid); 2463 im2 = eina_hash_find(gl_context->shared->native_wl_hash, &wlid);
2463 if (im2 == im) return im; 2464 if (im2 == im) return im;
2464 if (im2) 2465 if (im2)
2465 { 2466 {
@@ -2473,7 +2474,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2473# endif 2474# endif
2474#endif 2475#endif
2475 } 2476 }
2476 im2 = glsym_evas_gl_common_image_new_from_data(eng_get_ob(re)->gl_context, 2477 im2 = glsym_evas_gl_common_image_new_from_data(gl_context,
2477 im->w, im->h, NULL, im->alpha, 2478 im->w, im->h, NULL, im->alpha,
2478 EVAS_COLORSPACE_ARGB8888); 2479 EVAS_COLORSPACE_ARGB8888);
2479 glsym_evas_gl_common_image_free(im); 2480 glsym_evas_gl_common_image_free(im);
@@ -2519,7 +2520,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2519 config_attrs[i++] = EGL_PIXMAP_BIT; 2520 config_attrs[i++] = EGL_PIXMAP_BIT;
2520 config_attrs[i++] = EGL_NONE; 2521 config_attrs[i++] = EGL_NONE;
2521 2522
2522 if (!eglChooseConfig(eng_get_ob(re)->egl_disp, config_attrs, 2523 if (!eglChooseConfig(ob->egl_disp, config_attrs,
2523 &egl_config, 1, &num_config)) 2524 &egl_config, 1, &num_config))
2524 { 2525 {
2525 int err = eglGetError(); 2526 int err = eglGetError();
@@ -2533,7 +2534,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2533 { 2534 {
2534 int val; 2535 int val;
2535 if (extn_have_y_inverted && 2536 if (extn_have_y_inverted &&
2536 eglGetConfigAttrib(eng_get_ob(re)->egl_disp, egl_config, 2537 eglGetConfigAttrib(ob->egl_disp, egl_config,
2537 EGL_Y_INVERTED_NOK, &val)) 2538 EGL_Y_INVERTED_NOK, &val))
2538 yinvert = val; 2539 yinvert = val;
2539 } 2540 }
@@ -2541,7 +2542,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2541 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 2542 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
2542 n->ns_data.x11.pixmap = pm; 2543 n->ns_data.x11.pixmap = pm;
2543 n->ns_data.x11.visual = vis; 2544 n->ns_data.x11.visual = vis;
2544 n->ns_data.x11.surface = glsym_evas_gl_common_eglCreateImage(eng_get_ob(re)->egl_disp, 2545 n->ns_data.x11.surface = glsym_evas_gl_common_eglCreateImage(ob->egl_disp,
2545 EGL_NO_CONTEXT, 2546 EGL_NO_CONTEXT,
2546 EGL_NATIVE_PIXMAP_KHR, 2547 EGL_NATIVE_PIXMAP_KHR,
2547 (void *)pm, NULL); 2548 (void *)pm, NULL);
@@ -2561,15 +2562,15 @@ eng_image_native_set(void *engine, void *image, void *native)
2561 n->ns_data.x11.config = (void *)egl_config; 2562 n->ns_data.x11.config = (void *)egl_config;
2562 im->native.yinvert = yinvert; 2563 im->native.yinvert = yinvert;
2563 im->native.loose = 0; 2564 im->native.loose = 0;
2564 im->native.disp = eng_get_ob(re)->egl_disp; 2565 im->native.disp = ob->egl_disp;
2565 im->native.shared = eng_get_ob(re)->gl_context->shared; 2566 im->native.shared = gl_context->shared;
2566 im->native.data = n; 2567 im->native.data = n;
2567 im->native.func.bind = _native_bind_cb; 2568 im->native.func.bind = _native_bind_cb;
2568 im->native.func.unbind = _native_unbind_cb; 2569 im->native.func.unbind = _native_unbind_cb;
2569 im->native.func.free = _native_free_cb; 2570 im->native.func.free = _native_free_cb;
2570 im->native.target = GL_TEXTURE_2D; 2571 im->native.target = GL_TEXTURE_2D;
2571 im->native.mipmap = 0; 2572 im->native.mipmap = 0;
2572 eina_hash_add(eng_get_ob(re)->gl_context->shared->native_pm_hash, &pmid, im); 2573 eina_hash_add(ob->gl_context->shared->native_pm_hash, &pmid, im);
2573 glsym_evas_gl_common_image_native_enable(im); 2574 glsym_evas_gl_common_image_native_enable(im);
2574 } 2575 }
2575 } 2576 }
@@ -2582,7 +2583,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2582 Window wdummy; 2583 Window wdummy;
2583 2584
2584 // fixme: round trip :( 2585 // fixme: round trip :(
2585 XGetGeometry(eng_get_ob(re)->disp, pm, &wdummy, &dummy, &dummy, 2586 XGetGeometry(ob->disp, pm, &wdummy, &dummy, &dummy,
2586 &w, &h, &border, &depth); 2587 &w, &h, &border, &depth);
2587 if (depth <= 32) 2588 if (depth <= 32)
2588 { 2589 {
@@ -2630,8 +2631,8 @@ eng_image_native_set(void *engine, void *image, void *native)
2630 2631
2631 config_attrs[i++] = 0; 2632 config_attrs[i++] = 0;
2632 2633
2633 configs = glXChooseFBConfig(eng_get_ob(re)->disp, 2634 configs = glXChooseFBConfig(ob->disp,
2634 eng_get_ob(re)->screen, 2635 ob->screen,
2635 config_attrs, 2636 config_attrs,
2636 &num); 2637 &num);
2637 if (configs) 2638 if (configs)
@@ -2645,42 +2646,42 @@ eng_image_native_set(void *engine, void *image, void *native)
2645 { 2646 {
2646 XVisualInfo *vi; 2647 XVisualInfo *vi;
2647 2648
2648 vi = glXGetVisualFromFBConfig(eng_get_ob(re)->disp, configs[j]); 2649 vi = glXGetVisualFromFBConfig(ob->disp, configs[j]);
2649 if (!vi) continue; 2650 if (!vi) continue;
2650 if (vi->depth != (int)depth) continue; 2651 if (vi->depth != (int)depth) continue;
2651 XFree(vi); 2652 XFree(vi);
2652 2653
2653 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j], 2654 glXGetFBConfigAttrib(ob->disp, configs[j],
2654 GLX_BUFFER_SIZE, &val); 2655 GLX_BUFFER_SIZE, &val);
2655 if (val != (int) depth) continue; 2656 if (val != (int) depth) continue;
2656 } 2657 }
2657 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j], 2658 glXGetFBConfigAttrib(ob->disp, configs[j],
2658 GLX_DRAWABLE_TYPE, &val); 2659 GLX_DRAWABLE_TYPE, &val);
2659 if (!(val & GLX_PIXMAP_BIT)) continue; 2660 if (!(val & GLX_PIXMAP_BIT)) continue;
2660 tex_format = GLX_TEXTURE_FORMAT_RGB_EXT; 2661 tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
2661 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j], 2662 glXGetFBConfigAttrib(ob->disp, configs[j],
2662 GLX_ALPHA_SIZE, &val); 2663 GLX_ALPHA_SIZE, &val);
2663 if ((depth == 32) && (!val)) continue; 2664 if ((depth == 32) && (!val)) continue;
2664 if (val > 0) 2665 if (val > 0)
2665 { 2666 {
2666 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j], 2667 glXGetFBConfigAttrib(ob->disp, configs[j],
2667 GLX_BIND_TO_TEXTURE_RGBA_EXT, &val); 2668 GLX_BIND_TO_TEXTURE_RGBA_EXT, &val);
2668 if (val) tex_format = GLX_TEXTURE_FORMAT_RGBA_EXT; 2669 if (val) tex_format = GLX_TEXTURE_FORMAT_RGBA_EXT;
2669 } 2670 }
2670 else 2671 else
2671 { 2672 {
2672 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j], 2673 glXGetFBConfigAttrib(ob->disp, configs[j],
2673 GLX_BIND_TO_TEXTURE_RGB_EXT, &val); 2674 GLX_BIND_TO_TEXTURE_RGB_EXT, &val);
2674 if (val) tex_format = GLX_TEXTURE_FORMAT_RGB_EXT; 2675 if (val) tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
2675 } 2676 }
2676 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j], 2677 glXGetFBConfigAttrib(ob->disp, configs[j],
2677 GLX_Y_INVERTED_EXT, &val); 2678 GLX_Y_INVERTED_EXT, &val);
2678 if (val) yinvert = 1; 2679 if (val) yinvert = 1;
2679 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j], 2680 glXGetFBConfigAttrib(ob->disp, configs[j],
2680 GLX_BIND_TO_TEXTURE_TARGETS_EXT, 2681 GLX_BIND_TO_TEXTURE_TARGETS_EXT,
2681 &val); 2682 &val);
2682 tex_target = val; 2683 tex_target = val;
2683 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j], 2684 glXGetFBConfigAttrib(ob->disp, configs[j],
2684 GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val); 2685 GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
2685 mipmap = val; 2686 mipmap = val;
2686 n->ns_data.x11.config = configs[j]; 2687 n->ns_data.x11.config = configs[j];
@@ -2695,7 +2696,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2695 XFree(configs); 2696 XFree(configs);
2696 } 2697 }
2697 2698
2698 eina_hash_add(eng_get_ob(re)->gl_context->shared->native_pm_hash, &pmid, im); 2699 eina_hash_add(gl_context->shared->native_pm_hash, &pmid, im);
2699 if ((tex_target & GLX_TEXTURE_2D_BIT_EXT)) 2700 if ((tex_target & GLX_TEXTURE_2D_BIT_EXT))
2700 target = GLX_TEXTURE_2D_EXT; 2701 target = GLX_TEXTURE_2D_EXT;
2701 else if ((tex_target & GLX_TEXTURE_RECTANGLE_BIT_EXT)) 2702 else if ((tex_target & GLX_TEXTURE_RECTANGLE_BIT_EXT))
@@ -2728,7 +2729,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2728 n->ns_data.x11.pixmap = pm; 2729 n->ns_data.x11.pixmap = pm;
2729 n->ns_data.x11.visual = vis; 2730 n->ns_data.x11.visual = vis;
2730 if (glsym_glXCreatePixmap) 2731 if (glsym_glXCreatePixmap)
2731 n->ns_data.x11.surface = (void *)glsym_glXCreatePixmap(eng_get_ob(re)->disp, 2732 n->ns_data.x11.surface = (void *)glsym_glXCreatePixmap(ob->disp,
2732 n->ns_data.x11.config, 2733 n->ns_data.x11.config,
2733 n->ns_data.x11.pixmap, 2734 n->ns_data.x11.pixmap,
2734 pixmap_att); 2735 pixmap_att);
@@ -2742,7 +2743,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2742 { 2743 {
2743 ERR("no target :("); 2744 ERR("no target :(");
2744 if (glsym_glXQueryDrawable) 2745 if (glsym_glXQueryDrawable)
2745 glsym_glXQueryDrawable(eng_get_ob(re)->disp, 2746 glsym_glXQueryDrawable(ob->disp,
2746 n->ns_data.x11.pixmap, 2747 n->ns_data.x11.pixmap,
2747 GLX_TEXTURE_TARGET_EXT, 2748 GLX_TEXTURE_TARGET_EXT,
2748 &target); 2749 &target);
@@ -2769,9 +2770,9 @@ eng_image_native_set(void *engine, void *image, void *native)
2769 else 2770 else
2770 ERR("GLX Pixmap create fail"); 2771 ERR("GLX Pixmap create fail");
2771 im->native.yinvert = yinvert; 2772 im->native.yinvert = yinvert;
2772 im->native.loose = eng_get_ob(re)->detected.loose_binding; 2773 im->native.loose = ob->detected.loose_binding;
2773 im->native.disp = eng_get_ob(re)->disp; 2774 im->native.disp = ob->disp;
2774 im->native.shared = eng_get_ob(re)->gl_context->shared; 2775 im->native.shared = gl_context->shared;
2775 im->native.data = n; 2776 im->native.data = n;
2776 im->native.func.bind = _native_bind_cb; 2777 im->native.func.bind = _native_bind_cb;
2777 im->native.func.unbind = _native_unbind_cb; 2778 im->native.func.unbind = _native_unbind_cb;
@@ -2793,18 +2794,18 @@ eng_image_native_set(void *engine, void *image, void *native)
2793 { 2794 {
2794 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 2795 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
2795 2796
2796 eina_hash_add(eng_get_ob(re)->gl_context->shared->native_tex_hash, &texid, im); 2797 eina_hash_add(gl_context->shared->native_tex_hash, &texid, im);
2797 2798
2798 n->ns_data.opengl.surface = 0; 2799 n->ns_data.opengl.surface = 0;
2799 2800
2800 im->native.yinvert = 0; 2801 im->native.yinvert = 0;
2801 im->native.loose = 0; 2802 im->native.loose = 0;
2802#ifdef GL_GLES 2803#ifdef GL_GLES
2803 im->native.disp = eng_get_ob(re)->egl_disp; 2804 im->native.disp = ob->egl_disp;
2804#else 2805#else
2805 im->native.disp = eng_get_ob(re)->disp; 2806 im->native.disp = ob->disp;
2806#endif 2807#endif
2807 im->native.shared = eng_get_ob(re)->gl_context->shared; 2808 im->native.shared = gl_context->shared;
2808 im->native.data = n; 2809 im->native.data = n;
2809 im->native.func.bind = _native_bind_cb; 2810 im->native.func.bind = _native_bind_cb;
2810 im->native.func.unbind = _native_unbind_cb; 2811 im->native.func.unbind = _native_unbind_cb;
@@ -2827,13 +2828,13 @@ eng_image_native_set(void *engine, void *image, void *native)
2827 n = calloc(1, sizeof(Native)); 2828 n = calloc(1, sizeof(Native));
2828 if (n) 2829 if (n)
2829 { 2830 {
2830 eina_hash_add(eng_get_ob(re)->gl_context->shared->native_tbm_hash, &buffer, im); 2831 eina_hash_add(gl_context->shared->native_tbm_hash, &buffer, im);
2831 2832
2832 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 2833 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
2833 n->ns_data.tbm.buffer = buffer; 2834 n->ns_data.tbm.buffer = buffer;
2834 if (glsym_evas_gl_common_eglDestroyImage) 2835 if (glsym_evas_gl_common_eglDestroyImage)
2835 n->ns_data.tbm.surface = 2836 n->ns_data.tbm.surface =
2836 glsym_evas_gl_common_eglCreateImage(eng_get_ob(re)->egl_disp, 2837 glsym_evas_gl_common_eglCreateImage(ob->egl_disp,
2837 EGL_NO_CONTEXT, 2838 EGL_NO_CONTEXT,
2838 EGL_NATIVE_SURFACE_TIZEN, 2839 EGL_NATIVE_SURFACE_TIZEN,
2839 (void *)buffer, 2840 (void *)buffer,
@@ -2844,8 +2845,8 @@ eng_image_native_set(void *engine, void *image, void *native)
2844 ERR("eglCreateImage() for %p failed", buffer); 2845 ERR("eglCreateImage() for %p failed", buffer);
2845 im->native.yinvert = 1; 2846 im->native.yinvert = 1;
2846 im->native.loose = 0; 2847 im->native.loose = 0;
2847 im->native.disp = eng_get_ob(re)->egl_disp; 2848 im->native.disp = ob->egl_disp;
2848 im->native.shared = eng_get_ob(re)->gl_context->shared; 2849 im->native.shared = gl_context->shared;
2849 im->native.data = n; 2850 im->native.data = n;
2850 im->native.func.bind = _native_bind_cb; 2851 im->native.func.bind = _native_bind_cb;
2851 im->native.func.unbind = _native_unbind_cb; 2852 im->native.func.unbind = _native_unbind_cb;
@@ -2866,18 +2867,18 @@ eng_image_native_set(void *engine, void *image, void *native)
2866 { 2867 {
2867 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 2868 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
2868 2869
2869 eina_hash_add(eng_get_ob(re)->gl_context->shared->native_evasgl_hash, &buffer, im); 2870 eina_hash_add(gl_context->shared->native_evasgl_hash, &buffer, im);
2870 2871
2871 n->ns_data.evasgl.surface = ns->data.evasgl.surface; 2872 n->ns_data.evasgl.surface = ns->data.evasgl.surface;
2872 2873
2873 im->native.yinvert = 0; 2874 im->native.yinvert = 0;
2874 im->native.loose = 0; 2875 im->native.loose = 0;
2875#ifdef GL_GLES 2876#ifdef GL_GLES
2876 im->native.disp = eng_get_ob(re)->egl_disp; 2877 im->native.disp = ob->egl_disp;
2877#else 2878#else
2878 im->native.disp = eng_get_ob(re)->disp; 2879 im->native.disp = ob->disp;
2879#endif 2880#endif
2880 im->native.shared = eng_get_ob(re)->gl_context->shared; 2881 im->native.shared = gl_context->shared;
2881 im->native.data = n; 2882 im->native.data = n;
2882 im->native.func.bind = _native_bind_cb; 2883 im->native.func.bind = _native_bind_cb;
2883 im->native.func.unbind = _native_unbind_cb; 2884 im->native.func.unbind = _native_unbind_cb;
@@ -2904,7 +2905,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2904 EGLAttrib attribs[3]; 2905 EGLAttrib attribs[3];
2905 int format, yinvert = 1; 2906 int format, yinvert = 1;
2906 2907
2907 glsym_eglQueryWaylandBufferWL(eng_get_ob(re)->egl_disp, wl_buf, 2908 glsym_eglQueryWaylandBufferWL(ob->egl_disp, wl_buf,
2908 EGL_TEXTURE_FORMAT, &format); 2909 EGL_TEXTURE_FORMAT, &format);
2909 if ((format != EGL_TEXTURE_RGB) && 2910 if ((format != EGL_TEXTURE_RGB) &&
2910 (format != EGL_TEXTURE_RGBA)) 2911 (format != EGL_TEXTURE_RGBA))
@@ -2926,24 +2927,24 @@ eng_image_native_set(void *engine, void *image, void *native)
2926 attribs[2] = EGL_NONE; 2927 attribs[2] = EGL_NONE;
2927 2928
2928 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 2929 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
2929 if (glsym_eglQueryWaylandBufferWL(eng_get_ob(re)->egl_disp, wl_buf, 2930 if (glsym_eglQueryWaylandBufferWL(ob->egl_disp, wl_buf,
2930 EGL_WAYLAND_Y_INVERTED_WL, 2931 EGL_WAYLAND_Y_INVERTED_WL,
2931 &yinvert) == EGL_FALSE) 2932 &yinvert) == EGL_FALSE)
2932 yinvert = 1; 2933 yinvert = 1;
2933 eina_hash_add(eng_get_ob(re)->gl_context->shared->native_wl_hash, 2934 eina_hash_add(gl_context->shared->native_wl_hash,
2934 &wlid, im); 2935 &wlid, im);
2935 2936
2936 n->ns_data.wl_surface.wl_buf = wl_buf; 2937 n->ns_data.wl_surface.wl_buf = wl_buf;
2937 if (glsym_evas_gl_common_eglDestroyImage) 2938 if (glsym_evas_gl_common_eglDestroyImage)
2938 n->ns_data.wl_surface.surface = 2939 n->ns_data.wl_surface.surface =
2939 glsym_evas_gl_common_eglCreateImage(eng_get_ob(re)->egl_disp, 2940 glsym_evas_gl_common_eglCreateImage(ob->egl_disp,
2940 NULL, 2941 NULL,
2941 EGL_WAYLAND_BUFFER_WL, 2942 EGL_WAYLAND_BUFFER_WL,
2942 wl_buf, attribs); 2943 wl_buf, attribs);
2943 else 2944 else
2944 { 2945 {
2945 ERR("Try eglCreateImage on EGL with no support"); 2946 ERR("Try eglCreateImage on EGL with no support");
2946 eina_hash_del(eng_get_ob(re)->gl_context->shared->native_wl_hash, 2947 eina_hash_del(gl_context->shared->native_wl_hash,
2947 &wlid, im); 2948 &wlid, im);
2948 glsym_evas_gl_common_image_free(im); 2949 glsym_evas_gl_common_image_free(im);
2949 free(n); 2950 free(n);
@@ -2953,7 +2954,7 @@ eng_image_native_set(void *engine, void *image, void *native)
2953 if (!n->ns_data.wl_surface.surface) 2954 if (!n->ns_data.wl_surface.surface)
2954 { 2955 {
2955 ERR("eglCreatePixmapSurface() for %p failed", wl_buf); 2956 ERR("eglCreatePixmapSurface() for %p failed", wl_buf);
2956 eina_hash_del(eng_get_ob(re)->gl_context->shared->native_wl_hash, 2957 eina_hash_del(gl_context->shared->native_wl_hash,
2957 &wlid, im); 2958 &wlid, im);
2958 glsym_evas_gl_common_image_free(im); 2959 glsym_evas_gl_common_image_free(im);
2959 free(n); 2960 free(n);
@@ -2965,8 +2966,8 @@ eng_image_native_set(void *engine, void *image, void *native)
2965 //im->native.yinvert = yinvert; 2966 //im->native.yinvert = yinvert;
2966 im->native.yinvert = 1; 2967 im->native.yinvert = 1;
2967 im->native.loose = 0; 2968 im->native.loose = 0;
2968 im->native.disp = eng_get_ob(re)->egl_disp; 2969 im->native.disp = ob->egl_disp;
2969 im->native.shared = eng_get_ob(re)->gl_context->shared; 2970 im->native.shared = gl_context->shared;
2970 im->native.data = n; 2971 im->native.data = n;
2971 im->native.func.bind = _native_bind_cb; 2972 im->native.func.bind = _native_bind_cb;
2972 im->native.func.unbind = _native_unbind_cb; 2973 im->native.func.unbind = _native_unbind_cb;