diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2018-02-22 13:00:04 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2018-02-22 13:00:04 -0500 |
commit | cac28eeb7e68134cb8e48eec91407ed1c3727976 (patch) | |
tree | d47bd424e575a396e34f65a7c66ae0399d55f0d1 /src/lib/efl_wl/efl_wl.c | |
parent | 561bfbc55b6ccd9a95084d428d358179abcd58d1 (diff) |
efl-wl: send surface enter/leave based on compositor object visibility
this allows clients to conserve memory when the compositor is in a
hidden or obscured state
@feature
Diffstat (limited to '')
-rw-r--r-- | src/lib/efl_wl/efl_wl.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 863dcd9452..aa4925d30d 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c | |||
@@ -1287,6 +1287,17 @@ shell_surface_init(Comp_Surface *cs) | |||
1287 | } | 1287 | } |
1288 | 1288 | ||
1289 | static void | 1289 | static void |
1290 | comp_surface_output_leave(Comp_Surface *cs) | ||
1291 | { | ||
1292 | Eina_List *l; | ||
1293 | struct wl_resource *res; | ||
1294 | |||
1295 | EINA_LIST_FOREACH(cs->c->output_resources, l, res) | ||
1296 | if (wl_resource_get_client(res) == wl_resource_get_client(cs->res)) | ||
1297 | wl_surface_send_leave(cs->res, res); | ||
1298 | } | ||
1299 | |||
1300 | static void | ||
1290 | comp_surface_output_enter(Comp_Surface *cs) | 1301 | comp_surface_output_enter(Comp_Surface *cs) |
1291 | { | 1302 | { |
1292 | Eina_List *l; | 1303 | Eina_List *l; |
@@ -2579,7 +2590,10 @@ comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint | |||
2579 | c->surfaces = eina_inlist_prepend(c->surfaces, EINA_INLIST_GET(cs)); | 2590 | c->surfaces = eina_inlist_prepend(c->surfaces, EINA_INLIST_GET(cs)); |
2580 | c->surfaces_count++; | 2591 | c->surfaces_count++; |
2581 | eina_hash_list_append(c->client_surfaces, &client, cs); | 2592 | eina_hash_list_append(c->client_surfaces, &client, cs); |
2582 | comp_surface_output_enter(cs); | 2593 | if (evas_object_visible_get(cs->c->clip)) |
2594 | comp_surface_output_enter(cs); | ||
2595 | else | ||
2596 | comp_surface_output_leave(cs); | ||
2583 | 2597 | ||
2584 | cs->opaque = tiler_new(); | 2598 | cs->opaque = tiler_new(); |
2585 | cs->input = tiler_new(); | 2599 | cs->input = tiler_new(); |
@@ -3188,7 +3202,12 @@ output_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id) | |||
3188 | output_resize(c, res); | 3202 | output_resize(c, res); |
3189 | EINA_INLIST_FOREACH(c->surfaces, cs) | 3203 | EINA_INLIST_FOREACH(c->surfaces, cs) |
3190 | if (wl_resource_get_client(cs->res) == client) | 3204 | if (wl_resource_get_client(cs->res) == client) |
3191 | comp_surface_output_enter(cs); | 3205 | { |
3206 | if (evas_object_visible_get(c->clip)) | ||
3207 | comp_surface_output_enter(cs); | ||
3208 | else | ||
3209 | comp_surface_output_leave(cs); | ||
3210 | } | ||
3192 | } | 3211 | } |
3193 | 3212 | ||
3194 | ///////////////////////////////////////////////////////////////// | 3213 | ///////////////////////////////////////////////////////////////// |
@@ -5477,14 +5496,22 @@ static void | |||
5477 | comp_smart_show(Evas_Object *obj) | 5496 | comp_smart_show(Evas_Object *obj) |
5478 | { | 5497 | { |
5479 | Comp *c = evas_object_smart_data_get(obj); | 5498 | Comp *c = evas_object_smart_data_get(obj); |
5499 | Comp_Surface *cs; | ||
5500 | |||
5480 | evas_object_show(c->clip); | 5501 | evas_object_show(c->clip); |
5502 | EINA_INLIST_FOREACH(c->surfaces, cs) | ||
5503 | comp_surface_output_leave(cs); | ||
5481 | } | 5504 | } |
5482 | 5505 | ||
5483 | static void | 5506 | static void |
5484 | comp_smart_hide(Evas_Object *obj) | 5507 | comp_smart_hide(Evas_Object *obj) |
5485 | { | 5508 | { |
5486 | Comp *c = evas_object_smart_data_get(obj); | 5509 | Comp *c = evas_object_smart_data_get(obj); |
5510 | Comp_Surface *cs; | ||
5511 | |||
5487 | evas_object_hide(c->clip); | 5512 | evas_object_hide(c->clip); |
5513 | EINA_INLIST_FOREACH(c->surfaces, cs) | ||
5514 | comp_surface_output_leave(cs); | ||
5488 | } | 5515 | } |
5489 | 5516 | ||
5490 | static void | 5517 | static void |