summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_egl/evas_engine.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-08-14 17:07:31 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-08-18 14:27:31 -0500
commite3b9fbaed8e5e5f3730d3a8aa406873f8df60744 (patch)
treef241826d5e6388a86ca41ba3e5392cdb886da689 /src/modules/evas/engines/wayland_egl/evas_engine.c
parentccc4ffc80d0ca401dd58fc4fc573ab110f5cbd8e (diff)
wayland: Put Ecore_Wl2_Win instead of wl_surface into the engines
We'll need to track some state in a common way, so attaching it to the window seems like a good idea.
Diffstat (limited to 'src/modules/evas/engines/wayland_egl/evas_engine.c')
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 02766aa..1e32983 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -279,11 +279,13 @@ evgl_eng_native_window_create(void *data)
279 Render_Engine *re; 279 Render_Engine *re;
280 Outbuf *ob; 280 Outbuf *ob;
281 struct wl_egl_window *win; 281 struct wl_egl_window *win;
282 struct wl_surface *wls;
282 283
283 if (!(re = (Render_Engine *)data)) return NULL; 284 if (!(re = (Render_Engine *)data)) return NULL;
284 if (!(ob = eng_get_ob(re))) return NULL; 285 if (!(ob = eng_get_ob(re))) return NULL;
285 286
286 if (!(win = wl_egl_window_create(ob->info->info.wl_surface, 1, 1))) 287 wls = ecore_wl2_window_surface_get(ob->info->info.wl2_win);
288 if (!(win = wl_egl_window_create(wls, 1, 1)))
287 { 289 {
288 ERR("Could not create wl_egl window"); 290 ERR("Could not create wl_egl window");
289 return NULL; 291 return NULL;
@@ -671,6 +673,7 @@ static int
671eng_update(void *engine EINA_UNUSED, void *data, void *info, unsigned int w, unsigned int h) 673eng_update(void *engine EINA_UNUSED, void *data, void *info, unsigned int w, unsigned int h)
672{ 674{
673 Evas_Engine_Info_Wayland *inf = info; 675 Evas_Engine_Info_Wayland *inf = info;
676 struct wl_surface *wls;
674 Render_Engine *re = data; 677 Render_Engine *re = data;
675 Outbuf *ob; 678 Outbuf *ob;
676 679
@@ -689,13 +692,14 @@ eng_update(void *engine EINA_UNUSED, void *data, void *info, unsigned int w, uns
689 return 1; 692 return 1;
690 } 693 }
691 694
692 if (!inf->info.wl_surface && (ob->egl_surface != EGL_NO_SURFACE)) 695 wls = ecore_wl2_window_surface_get(inf->info.wl2_win);
696 if (!wls && (ob->egl_surface != EGL_NO_SURFACE))
693 { 697 {
694 eglDestroySurface(ob->egl_disp, ob->egl_surface); 698 eglDestroySurface(ob->egl_disp, ob->egl_surface);
695 eglMakeCurrent(ob->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, 699 eglMakeCurrent(ob->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
696 EGL_NO_CONTEXT); 700 EGL_NO_CONTEXT);
697 ob->egl_surface = EGL_NO_SURFACE; 701 ob->egl_surface = EGL_NO_SURFACE;
698 ob->surface = NULL; 702 ob->wl2_win = NULL;
699 evas_render_engine_software_generic_update(&re->generic.software, 703 evas_render_engine_software_generic_update(&re->generic.software,
700 NULL, w, h); 704 NULL, w, h);
701 return 1; 705 return 1;
@@ -705,7 +709,7 @@ eng_update(void *engine EINA_UNUSED, void *data, void *info, unsigned int w, uns
705 { 709 {
706 ob->info = inf; 710 ob->info = inf;
707 if ((ob->info->info.wl_display != ob->disp) || 711 if ((ob->info->info.wl_display != ob->disp) ||
708 (ob->info->info.wl_surface != ob->surface) || 712 (ob->info->info.wl2_win != ob->wl2_win) ||
709 /* FIXME: comment out below line. 713 /* FIXME: comment out below line.
710 * since there is no place set the info->info.win for now, 714 * since there is no place set the info->info.win for now,
711 * it causes renew the window unnecessarily. 715 * it causes renew the window unnecessarily.