evas: "fix" masks of masks inside a proxy
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 16 Dec 2016 02:19:17 +0000 (11:19 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 16 Dec 2016 02:29:47 +0000 (11:29 +0900)
commit2bed30b3984b4e73d64b99fe05d6574001173497
tree6c1078e851953251de1fe78a6517c3a1bc71685d
parent1c21cdfdbb782d389818871d1697ece1098e85c2
evas: "fix" masks of masks inside a proxy

Here's the situation:

1. A container (genlist) has a mask, M0.
2. An item I0 inside this container uses a proxy P0 as render object
   rather than the item directly (eg. for zooming in/out).
3. An element E0 inside this item has another mask, M1.

Theory:
1. The proxy surface for P0 is rendered, and M1 is applied to
   the element E0.
2. The proxy P0 is rendered on the canvas, with M0 applied.

Practice:
1. The element E0 is prepared for rendering, this triggers
   a mask subrender for M1.
2. M1 is rendered with M0 as a prev mask, then kept in cache and
   not redrawn (no geometry change, etc...)
3. When P0's surface is rendered, M1's surface is the result of M1+M0.
4. When P0 is drawn on screen, we can see the effect of M1+M0 as
   P0's geometry might be different from the item's I0.

Solution:
Discard prev masks and force a mask redraw when we're inside a
proxy. Ideally we should detect if the prev mask belongs to the
insides of the proxy or not.

Problems:
_mask_apply_inside_proxy() is definitely not correct, but it's
not easy to test it. Anyway I believe that in order to properly
implement all of this, we need to rethink evas_render and
the draw context. Non-primary render surfaces (maps, proxies,
masks, filters, ...) should be rendered with a clean context
and clipping, masking, etc should be computed appropriately.
src/lib/evas/canvas/evas_render.c