summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_shm/evas_shm.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-08-14 18:21:22 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-08-18 14:27:32 -0500
commit972633e7e8bf59d3df4f4c810e7403a05b9f5174 (patch)
treef0ac0463ae90f62cd6222c58b2827dcf93586461 /src/modules/evas/engines/wayland_shm/evas_shm.c
parent8f038b25914b9df738809a4150cf3aa5c6d0798e (diff)
wayland_shm: Remove direct access to wl_surface
Querying it through Ecore_Wl2_Window now
Diffstat (limited to 'src/modules/evas/engines/wayland_shm/evas_shm.c')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index df08f90dfa..2edb9ee985 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -63,7 +63,6 @@ struct _Shm_Surface
63{ 63{
64 struct wl_display *disp; 64 struct wl_display *disp;
65 struct wl_shm *shm; 65 struct wl_shm *shm;
66 struct wl_surface *surface;
67 int w, h; 66 int w, h;
68 int num_buff; 67 int num_buff;
69 int compositor_version; 68 int compositor_version;
@@ -537,6 +536,7 @@ _evas_shm_surface_data_get(Surface *s, int *w, int *h)
537void 536void
538_evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count, Eina_Bool hidden) 537_evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count, Eina_Bool hidden)
539{ 538{
539 struct wl_surface *wls;
540 Shm_Surface *surf; 540 Shm_Surface *surf;
541 Shm_Leaf *leaf; 541 Shm_Leaf *leaf;
542 542
@@ -546,19 +546,19 @@ _evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count, Ei
546 leaf = surf->current; 546 leaf = surf->current;
547 if (!leaf) return; 547 if (!leaf) return;
548 548
549 if (!surf->surface) return; 549 wls = ecore_wl2_window_surface_get(s->info->info.wl2_win);
550 550
551 if (!hidden) 551 if (!hidden)
552 { 552 {
553 wl_surface_attach(surf->surface, leaf->data->buffer, 0, 0); 553 wl_surface_attach(wls, leaf->data->buffer, 0, 0);
554 554
555 _evas_surface_damage(surf->surface, surf->compositor_version, 555 _evas_surface_damage(wls, surf->compositor_version,
556 leaf->w, leaf->h, rects, count); 556 leaf->w, leaf->h, rects, count);
557 } 557 }
558 else 558 else
559 wl_surface_attach(surf->surface, NULL, 0, 0); 559 wl_surface_attach(wls, NULL, 0, 0);
560 560
561 wl_surface_commit(surf->surface); 561 wl_surface_commit(wls);
562 562
563 leaf->busy = EINA_TRUE; 563 leaf->busy = EINA_TRUE;
564 leaf->drawn = EINA_TRUE; 564 leaf->drawn = EINA_TRUE;
@@ -567,17 +567,16 @@ _evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count, Ei
567} 567}
568 568
569Eina_Bool 569Eina_Bool
570_evas_shm_surface_surface_set(Surface *s, struct wl_shm *wl_shm, struct zwp_linux_dmabuf_v1 *wl_dmabuf EINA_UNUSED, struct wl_surface *wl_surface) 570_evas_shm_surface_surface_set(Surface *s, struct wl_shm *wl_shm, struct zwp_linux_dmabuf_v1 *wl_dmabuf EINA_UNUSED)
571{ 571{
572 Shm_Surface *surf; 572 Shm_Surface *surf;
573 573
574 surf = s->surf.shm; 574 surf = s->surf.shm;
575 575
576 if ((surf->shm == wl_shm) && (surf->surface == wl_surface)) 576 if ((surf->shm == wl_shm))
577 return EINA_FALSE; 577 return EINA_FALSE;
578 578
579 surf->shm = wl_shm; 579 surf->shm = wl_shm;
580 surf->surface = wl_surface;
581 return EINA_TRUE; 580 return EINA_TRUE;
582} 581}
583 582
@@ -596,7 +595,6 @@ _evas_shm_surface_create(Surface *s, int w, int h, int num_buff)
596 surf->h = h; 595 surf->h = h;
597 surf->disp = s->info->info.wl_display; 596 surf->disp = s->info->info.wl_display;
598 surf->shm = s->info->info.wl_shm; 597 surf->shm = s->info->info.wl_shm;
599 surf->surface = ecore_wl2_window_surface_get(s->info->info.wl2_win);
600 surf->num_buff = num_buff; 598 surf->num_buff = num_buff;
601 surf->alpha = s->info->info.destination_alpha; 599 surf->alpha = s->info->info.destination_alpha;
602 surf->compositor_version = s->info->info.compositor_version; 600 surf->compositor_version = s->info->info.compositor_version;