summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c10
-rw-r--r--src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h2
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c12
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.h2
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_wl_main.c9
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_dmabuf.c2
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_engine.c6
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_outbuf.c5
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c2
9 files changed, 31 insertions, 19 deletions
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index ad307ed..51a55e4 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -136,7 +136,7 @@ _ee_display_unset(Ecore_Evas *ee)
136 if (!einfo) return; 136 if (!einfo) return;
137 137
138 einfo->info.wl_display = NULL; 138 einfo->info.wl_display = NULL;
139 einfo->info.wl_surface = NULL; 139 einfo->info.wl2_win = NULL;
140 140
141 wdata = ee->engine.data; 141 wdata = ee->engine.data;
142 if (!strcmp(ee->driver, "wayland_egl")) 142 if (!strcmp(ee->driver, "wayland_egl"))
@@ -1663,7 +1663,7 @@ _ecore_evas_wl_common_render_flush_pre(void *data, Evas *evas, void *event EINA_
1663 einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(evas); 1663 einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(evas);
1664 if (!einfo) return; 1664 if (!einfo) return;
1665 1665
1666 surf = einfo->info.wl_surface; 1666 surf = ecore_wl2_window_surface_get(einfo->info.wl2_win);
1667 if (!surf) return; 1667 if (!surf) return;
1668 1668
1669 wdata = ee->engine.data; 1669 wdata = ee->engine.data;
@@ -2018,7 +2018,7 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
2018 einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas); 2018 einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
2019 if (einfo) 2019 if (einfo)
2020 { 2020 {
2021 einfo->info.wl_surface = ecore_wl2_window_surface_get(wdata->win); 2021 einfo->info.wl2_win = wdata->win;
2022 einfo->info.hidden = wdata->win->pending.configure; //EINA_FALSE; 2022 einfo->info.hidden = wdata->win->pending.configure; //EINA_FALSE;
2023 einfo->www_avail = !!wdata->win->www_surface; 2023 einfo->www_avail = !!wdata->win->www_surface;
2024 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 2024 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
@@ -2147,7 +2147,7 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED)
2147 ecore_wl2_display_compositor_version_get(wdata->display); 2147 ecore_wl2_display_compositor_version_get(wdata->display);
2148 einfo->info.destination_alpha = EINA_TRUE; 2148 einfo->info.destination_alpha = EINA_TRUE;
2149 einfo->info.rotation = ee->rotation; 2149 einfo->info.rotation = ee->rotation;
2150 einfo->info.wl_surface = ecore_wl2_window_surface_get(wdata->win); 2150 einfo->info.wl2_win = wdata->win;
2151 2151
2152 if (wdata->reset_pending) 2152 if (wdata->reset_pending)
2153 { 2153 {
@@ -2447,7 +2447,7 @@ _ecore_evas_wl_common_new_internal(const char *disp_name, unsigned int parent, i
2447 einfo->info.destination_alpha = EINA_TRUE; 2447 einfo->info.destination_alpha = EINA_TRUE;
2448 einfo->info.rotation = ee->rotation; 2448 einfo->info.rotation = ee->rotation;
2449 einfo->info.depth = 32; 2449 einfo->info.depth = 32;
2450 einfo->info.wl_surface = ecore_wl2_window_surface_get(wdata->win); 2450 einfo->info.wl2_win = wdata->win;
2451 einfo->info.wl_dmabuf = ecore_wl2_display_dmabuf_get(ewd); 2451 einfo->info.wl_dmabuf = ecore_wl2_display_dmabuf_get(ewd);
2452 einfo->info.wl_shm = ecore_wl2_display_shm_get(ewd); 2452 einfo->info.wl_shm = ecore_wl2_display_shm_get(ewd);
2453 einfo->info.compositor_version = 2453 einfo->info.compositor_version =
diff --git a/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h b/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
index 4a3ca6b..7be7e2e 100644
--- a/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
+++ b/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
@@ -18,7 +18,7 @@ struct _Evas_Engine_Info_Wayland
18 struct wl_shm *wl_shm; 18 struct wl_shm *wl_shm;
19 struct zwp_linux_dmabuf_v1 *wl_dmabuf; 19 struct zwp_linux_dmabuf_v1 *wl_dmabuf;
20 struct wl_display *wl_display; 20 struct wl_display *wl_display;
21 struct wl_surface *wl_surface; 21 Ecore_Wl2_Window *wl2_win;
22 int depth, rotation, edges; 22 int depth, rotation, edges;
23 int compositor_version; 23 int compositor_version;
24 Eina_Bool destination_alpha : 1; 24 Eina_Bool destination_alpha : 1;
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.
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.h b/src/modules/evas/engines/wayland_egl/evas_engine.h
index 3d88285..c25e072 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.h
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.h
@@ -57,7 +57,7 @@ struct _Outbuf
57{ 57{
58 struct wl_display *disp; 58 struct wl_display *disp;
59 struct wl_egl_window *win; 59 struct wl_egl_window *win;
60 struct wl_surface *surface; 60 Ecore_Wl2_Window *wl2_win;
61 int w, h; 61 int w, h;
62 int depth, screen, rot, alpha; 62 int depth, screen, rot, alpha;
63 63
diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
index 90f3d40..9cfd52b 100644
--- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c
+++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
@@ -29,10 +29,10 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Engine_Swap
29 gw->h = h; 29 gw->h = h;
30 gw->swap_mode = swap_mode; 30 gw->swap_mode = swap_mode;
31 gw->disp = einfo->info.wl_display; 31 gw->disp = einfo->info.wl_display;
32 gw->wl2_win = einfo->info.wl2_win;
32 if (display && (display != gw->disp)) 33 if (display && (display != gw->disp))
33 context = EGL_NO_CONTEXT; 34 context = EGL_NO_CONTEXT;
34 display = gw->disp; 35 display = gw->disp;
35 gw->surface = einfo->info.wl_surface;
36 gw->depth = einfo->info.depth; 36 gw->depth = einfo->info.depth;
37 gw->alpha = einfo->info.destination_alpha; 37 gw->alpha = einfo->info.destination_alpha;
38 gw->rot = einfo->info.rotation; 38 gw->rot = einfo->info.rotation;
@@ -277,15 +277,18 @@ eng_window_unsurf(Outbuf *gw)
277void 277void
278eng_window_resurf(Outbuf *gw) 278eng_window_resurf(Outbuf *gw)
279{ 279{
280 struct wl_surface *wls;
281
280 if (gw->surf) return; 282 if (gw->surf) return;
281 if (getenv("EVAS_GL_INFO")) printf("resurf %p\n", gw); 283 if (getenv("EVAS_GL_INFO")) printf("resurf %p\n", gw);
282 if ((!gw->w) || (!gw->h)) return; 284 if ((!gw->w) || (!gw->h)) return;
283 if (!gw->win) 285 if (!gw->win)
284 { 286 {
287 wls = ecore_wl2_window_surface_get(gw->wl2_win);
285 if ((gw->rot == 0) || (gw->rot == 180)) 288 if ((gw->rot == 0) || (gw->rot == 180))
286 gw->win = wl_egl_window_create(gw->surface, gw->w, gw->h); 289 gw->win = wl_egl_window_create(wls, gw->w, gw->h);
287 else if ((gw->rot == 90) || (gw->rot == 270)) 290 else if ((gw->rot == 90) || (gw->rot == 270))
288 gw->win = wl_egl_window_create(gw->surface, gw->h, gw->w); 291 gw->win = wl_egl_window_create(wls, gw->h, gw->w);
289 } 292 }
290 293
291 gw->egl_surface = 294 gw->egl_surface =
diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
index ca253ce..2bc5e7b 100644
--- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
@@ -788,7 +788,7 @@ _evas_dmabuf_surface_create(Surface *s, int w, int h, int num_buff)
788 surf->surface = s; 788 surf->surface = s;
789 surf->wl_display = s->info->info.wl_display; 789 surf->wl_display = s->info->info.wl_display;
790 surf->dmabuf = s->info->info.wl_dmabuf; 790 surf->dmabuf = s->info->info.wl_dmabuf;
791 surf->wl_surface = s->info->info.wl_surface; 791 surf->wl_surface = ecore_wl2_window_surface_get(s->info->info.wl2_win);
792 surf->alpha = s->info->info.destination_alpha; 792 surf->alpha = s->info->info.destination_alpha;
793 surf->compositor_version = s->info->info.compositor_version; 793 surf->compositor_version = s->info->info.compositor_version;
794 794
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c b/src/modules/evas/engines/wayland_shm/evas_engine.c
index a5f72c5..14c1ede 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.c
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.c
@@ -175,10 +175,12 @@ eng_update(void *engine, void *data, void *info, unsigned int w, unsigned int h)
175{ 175{
176 Evas_Engine_Info_Wayland *einfo = info; 176 Evas_Engine_Info_Wayland *einfo = info;
177 Render_Engine *re = data; 177 Render_Engine *re = data;
178 struct wl_surface *surf;
178 179
179 if (!einfo->info.wl_surface) return 0; 180 surf = ecore_wl2_window_surface_get(einfo->info.wl2_win);
181 if (!surf) return 0;
180 182
181 _evas_outbuf_surface_set(re->generic.ob, einfo->info.wl_shm, einfo->info.wl_dmabuf, einfo->info.wl_surface); 183 _evas_outbuf_surface_set(re->generic.ob, einfo->info.wl_shm, einfo->info.wl_dmabuf, surf);
182 184
183 eng_output_resize(engine, data, w, h); 185 eng_output_resize(engine, data, w, h);
184 186
diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
index b76efad..7aed71f 100644
--- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
@@ -639,8 +639,11 @@ _evas_outbuf_update_region_free(Outbuf *ob EINA_UNUSED, RGBA_Image *update EINA_
639void 639void
640_evas_outbuf_redraws_clear(Outbuf *ob) 640_evas_outbuf_redraws_clear(Outbuf *ob)
641{ 641{
642 struct wl_surface *wls;
643
642 if (!ob->priv.rect_count) return; 644 if (!ob->priv.rect_count) return;
643 if (ob->info->info.wl_surface) 645 wls = ecore_wl2_window_surface_get(ob->info->info.wl2_win);
646 if (wls)
644 ob->surface->funcs.post(ob->surface, ob->priv.rects, ob->priv.rect_count, ob->hidden); 647 ob->surface->funcs.post(ob->surface, ob->priv.rects, ob->priv.rect_count, ob->hidden);
645 free(ob->priv.rects); 648 free(ob->priv.rects);
646 ob->priv.rect_count = 0; 649 ob->priv.rect_count = 0;
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 28feb3f..df08f90 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -596,7 +596,7 @@ _evas_shm_surface_create(Surface *s, int w, int h, int num_buff)
596 surf->h = h; 596 surf->h = h;
597 surf->disp = s->info->info.wl_display; 597 surf->disp = s->info->info.wl_display;
598 surf->shm = s->info->info.wl_shm; 598 surf->shm = s->info->info.wl_shm;
599 surf->surface = s->info->info.wl_surface; 599 surf->surface = ecore_wl2_window_surface_get(s->info->info.wl2_win);
600 surf->num_buff = num_buff; 600 surf->num_buff = num_buff;
601 surf->alpha = s->info->info.destination_alpha; 601 surf->alpha = s->info->info.destination_alpha;
602 surf->compositor_version = s->info->info.compositor_version; 602 surf->compositor_version = s->info->info.compositor_version;