diff options
author | Chris Michael <cp.michael@samsung.com> | 2014-07-18 02:46:42 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2014-08-04 18:01:22 -0400 |
commit | dc4c1c181b099205114598a9746775925d17ef2b (patch) | |
tree | 2eeb28cbade5901555de713b5870f330a57d117d | |
parent | 2e8178790fbb952752ccaf2be8f1b27a9a6e90c0 (diff) | |
download | enlightenment-dc4c1c181b099205114598a9746775925d17ef2b.tar.gz |
handle setting any pending opaque regions during surface commit and
cleanup the input region code also
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r-- | src/bin/e_comp_wl.c | 76 |
1 files changed, 57 insertions, 19 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index ada808ce9f..76493cc41f 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -642,6 +642,51 @@ _e_comp_wl_surface_commit(E_Client *ec) ec->wl_comp_data->pending.buffer = NULL; ec->wl_comp_data->pending.new_attach = EINA_FALSE; + /* handle surface opaque region */ + tmp = eina_tiler_new(ec->w, ec->h); + eina_tiler_tile_size_set(tmp, 1, 1); + eina_tiler_rect_add(tmp, &(Eina_Rectangle){0, 0, ec->client.w, ec->client.h}); + + src = eina_tiler_intersection(ec->wl_comp_data->pending.opaque, tmp); + if (src) + { + Eina_Rectangle *rect; + Eina_Iterator *itr; + int i = 0; + + ec->shape_rects_num = 0; + + itr = eina_tiler_iterator_new(src); + EINA_ITERATOR_FOREACH(itr, rect) + { + ec->shape_rects_num += 1; + } + + ec->shape_rects = + malloc(sizeof(Eina_Rectangle) * ec->shape_rects_num); + + if (ec->shape_rects) + { + EINA_ITERATOR_FOREACH(itr, rect) + { + ec->shape_rects[i] = *(Eina_Rectangle *)((char *)rect); + + ec->shape_rects[i].x = rect->x; + ec->shape_rects[i].y = rect->y; + ec->shape_rects[i].w = rect->w; + ec->shape_rects[i].h = rect->h; + + i++; + } + } + + eina_iterator_free(itr); + eina_tiler_free(src); + } + + eina_tiler_free(tmp); + eina_tiler_clear(ec->wl_comp_data->pending.opaque); + /* handle surface damages */ if ((!ec->comp->nocomp) && (ec->frame)) { @@ -671,9 +716,7 @@ _e_comp_wl_surface_commit(E_Client *ec) eina_tiler_clear(ec->wl_comp_data->pending.damage); } - /* TODO !!! FIXME !!! */ - /* handle surface opaque region */ - + /* handle input regions */ tmp = eina_tiler_new(ec->w, ec->h); eina_tiler_tile_size_set(tmp, 1, 1); eina_tiler_rect_add(tmp, &(Eina_Rectangle){0, 0, ec->client.w, ec->client.h}); @@ -696,25 +739,20 @@ _e_comp_wl_surface_commit(E_Client *ec) ec->shape_input_rects = malloc(sizeof(Eina_Rectangle) * ec->shape_input_rects_num); - if (!ec->shape_input_rects) + if (ec->shape_input_rects) { - eina_iterator_free(itr); - eina_tiler_free(src); - eina_tiler_free(tmp); - return; - } + EINA_ITERATOR_FOREACH(itr, rect) + { + ec->shape_input_rects[i] = + *(Eina_Rectangle *)((char *)rect); - EINA_ITERATOR_FOREACH(itr, rect) - { - ec->shape_input_rects[i] = - *(Eina_Rectangle *)((char *)rect); + ec->shape_input_rects[i].x = rect->x; + ec->shape_input_rects[i].y = rect->y; + ec->shape_input_rects[i].w = rect->w; + ec->shape_input_rects[i].h = rect->h; - ec->shape_input_rects[i].x = rect->x; - ec->shape_input_rects[i].y = rect->y; - ec->shape_input_rects[i].w = rect->w; - ec->shape_input_rects[i].h = rect->h; - - i++; + i++; + } } eina_iterator_free(itr); |