summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHermet Park <chuneon.park@samsung.com>2020-05-10 16:03:10 +0900
committerHermet Park <chuneon.park@samsung.com>2020-05-10 16:08:03 +0900
commiteaafb9e4c53863cfd0ae4aaf24f04d333458ff2b (patch)
tree77558f0d23b7232c2ca4eef61400236e54faaa8f
parentddcc7ab82514b73f9c3a8b1cc933761ca04ff5d0 (diff)
canvas render: don't apply mask if the objects in the map.
Current mask is shared across the objects hierarchy, children would try to apply this mask on the rendering when it's enabled by the parent. but if the map is enabled from one of parents, children should not apply the parents mask but leaves it to the parent's job. @fix
-rw-r--r--src/lib/evas/canvas/evas_render.c73
1 files changed, 47 insertions, 26 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 1d47ba06af..3e71e40af1 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -438,6 +438,18 @@ _evas_render_object_is_mask(Evas_Object_Protected_Data *obj)
438 return EINA_FALSE; 438 return EINA_FALSE;
439} 439}
440 440
441static inline Evas_Object_Protected_Data *
442_evas_mask_owner_get(Evas_Object_Protected_Data *obj)
443{
444 Evas_Object_Protected_Data *parent = NULL;
445
446 if (!obj->smart.parent) return obj;
447 parent = efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
448 if (parent->clip.mask != obj->clip.mask) return obj;
449
450 return _evas_mask_owner_get(parent);
451}
452
441static void 453static void
442_evas_render_phase1_direct(Evas_Public_Data *e, 454_evas_render_phase1_direct(Evas_Public_Data *e,
443 Eina_Inarray *active_objects, 455 Eina_Inarray *active_objects,
@@ -2145,9 +2157,13 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
2145 if (obj->is_smart) 2157 if (obj->is_smart)
2146 { 2158 {
2147 /* Clipper masks */ 2159 /* Clipper masks */
2148 if (obj->cur->clipper && (mapped > 1) && 2160 if (obj->cur->clipper && (mapped > 1) && _evas_render_object_is_mask(obj->cur->clipper))
2149 _evas_render_object_is_mask(obj->cur->clipper)) 2161 {
2150 _evas_render_mapped_mask(evas, obj, obj->cur->clipper, proxy_render_data, output, ctx, off_x, off_y, level, do_async); 2162 //Apply only owner mask in the map
2163 Evas_Object_Protected_Data *owner = _evas_mask_owner_get(obj);
2164 if (owner == obj || (_evas_render_has_map(owner) && !_evas_render_can_map(owner)))
2165 _evas_render_mapped_mask(evas, obj, obj->cur->clipper, proxy_render_data, output, ctx, off_x, off_y, level, do_async);
2166 }
2151 else if (!proxy_src_clip && proxy_render_data) 2167 else if (!proxy_src_clip && proxy_render_data)
2152 { 2168 {
2153 if (!_proxy_context_clip(evas, ctx, proxy_render_data, obj, off_x, off_y)) 2169 if (!_proxy_context_clip(evas, ctx, proxy_render_data, obj, off_x, off_y))
@@ -2194,35 +2210,40 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
2194 2210
2195 if (obj->cur->clipper && (mapped > 1)) 2211 if (obj->cur->clipper && (mapped > 1))
2196 { 2212 {
2197 Evas_Object_Protected_Data *mask = obj->clip.mask; 2213 //Apply only owner mask in the map
2198 2214 Evas_Object_Protected_Data *owner = _evas_mask_owner_get(obj);
2199 if (obj->mask->surface != surface) 2215 if (owner == obj || (_evas_render_has_map(owner) && !_evas_render_can_map(owner)))
2200 { 2216 {
2201 if (proxy_src_clip) 2217 Evas_Object_Protected_Data *mask = obj->clip.mask;
2218
2219 if (obj->mask->surface != surface)
2202 { 2220 {
2203 if ((_evas_render_has_map(obj) && !_evas_render_can_map(obj)) || 2221 if (proxy_src_clip)
2204 _evas_render_object_is_mask(obj->cur->clipper)) 2222 {
2205 evas_object_clip_recalc(obj); 2223 if ((_evas_render_has_map(obj) && !_evas_render_can_map(obj)) ||
2206 _evas_render_mapped_context_clip_set(evas, eo_obj, obj, ctx, 2224 _evas_render_object_is_mask(obj->cur->clipper))
2207 proxy_render_data, 2225 evas_object_clip_recalc(obj);
2208 off_x, off_y); 2226 _evas_render_mapped_context_clip_set(evas, eo_obj, obj, ctx,
2227 proxy_render_data,
2228 off_x, off_y);
2229 }
2230 else if (proxy_render_data)
2231 {
2232 if (!_proxy_context_clip(evas, ctx, proxy_render_data, obj, off_x, off_y))
2233 goto on_empty_clip;
2234 }
2209 } 2235 }
2210 else if (proxy_render_data) 2236 else
2211 { 2237 {
2212 if (!_proxy_context_clip(evas, ctx, proxy_render_data, obj, off_x, off_y)) 2238 // rendering a mask in its own surface:
2213 goto on_empty_clip; 2239 // we want to render it fully and clip only at
2240 // clippee (maskee) render time
2241 RD(level, " draw mask\n");
2214 } 2242 }
2215 }
2216 else
2217 {
2218 // rendering a mask in its own surface:
2219 // we want to render it fully and clip only at
2220 // clippee (maskee) render time
2221 RD(level, " draw mask\n");
2222 }
2223 2243
2224 /* Clipper masks */ 2244 /* Clipper masks */
2225 _evas_render_mapped_mask(evas, obj, mask, proxy_render_data, output, ctx, off_x, off_y, level, do_async); 2245 _evas_render_mapped_mask(evas, obj, mask, proxy_render_data, output, ctx, off_x, off_y, level, do_async);
2246 }
2226 } 2247 }
2227 2248
2228#ifdef REND_DBG 2249#ifdef REND_DBG