summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_shm/evas_shm.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-12-02 13:24:42 -0500
committerChris Michael <cp.michael@samsung.com>2016-12-02 14:25:10 -0500
commit9492ee21dfa642123043da5d5ef7954e886b0f9c (patch)
treeff5c937458453fe08cf3118c1b4f8c7b892aa11a /src/modules/evas/engines/wayland_shm/evas_shm.c
parent725e43954528f88de4369f8d4515173c47d660b1 (diff)
evas-wayland-shm: Fix issue of destroying & recreating wl_surfaces on hide
When a canvas gets hidden, we don't need to destroy & recreate the wl_surface. We can simply attach a NULL wl_buffer to the surface which achieves the same result. This saves us from having to always destroy & recreate surfaces when we hide/show. Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/modules/evas/engines/wayland_shm/evas_shm.c')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index b6667c7f71..d38a19fd49 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -543,9 +543,8 @@ _evas_shm_surface_data_get(Surface *s, int *w, int *h)
543} 543}
544 544
545void 545void
546_evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count) 546_evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count, Eina_Bool hidden)
547{ 547{
548 /* struct wl_callback *frame_cb; */
549 Shm_Surface *surf; 548 Shm_Surface *surf;
550 Shm_Leaf *leaf; 549 Shm_Leaf *leaf;
551 550
@@ -557,12 +556,15 @@ _evas_shm_surface_post(Surface *s, Eina_Rectangle *rects, unsigned int count)
557 556
558 if (!surf->surface) return; 557 if (!surf->surface) return;
559 558
560 wl_surface_attach(surf->surface, leaf->data->buffer, 0, 0); 559 if (!hidden)
560 {
561 wl_surface_attach(surf->surface, leaf->data->buffer, 0, 0);
561 562
562 _evas_surface_damage(surf->surface, surf->compositor_version, 563 _evas_surface_damage(surf->surface, surf->compositor_version,
563 leaf->w, leaf->h, rects, count); 564 leaf->w, leaf->h, rects, count);
564 /* frame_cb = wl_surface_frame(surface->surface); */ 565 }
565 /* wl_callback_add_listener(frame_cb, &_shm_frame_listener, surface); */ 566 else
567 wl_surface_attach(surf->surface, NULL, 0, 0);
566 568
567 wl_surface_commit(surf->surface); 569 wl_surface_commit(surf->surface);
568 570