e_comp_wl: Handle surface opaque region in subsurface commit from cache
Summary: When we commit a subsurface from cache, we should adjust the client's shape rectangles so that they get applied when rendering. Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1412
This commit is contained in:
parent
31045f715b
commit
ded8356fc7
|
@ -489,8 +489,55 @@ _e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
|
|||
eina_tiler_clear(sub_cdata->cached.damage);
|
||||
}
|
||||
|
||||
/* TODO !!! FIXME !!! */
|
||||
/* 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(sub_cdata->cached.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_free(itr);
|
||||
eina_tiler_free(src);
|
||||
eina_tiler_free(tmp);
|
||||
return;
|
||||
}
|
||||
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(sub_cdata->cached.opaque);
|
||||
|
||||
|
||||
tmp = eina_tiler_new(ec->w, ec->h);
|
||||
eina_tiler_tile_size_set(tmp, 1, 1);
|
||||
|
|
Loading…
Reference in New Issue