summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-02-05 16:11:45 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-02-05 22:31:16 +0900
commit69818e7c45743efb21071412278d205c6892c18e (patch)
tree2f4334f97babc822205293dfe5f802064cfbfc10
parent8abe1a06f8947e95320437dbae75f7f466233f9e (diff)
Evas masking: Fix another issue with masking
Fixes rendering in the following case: - Object with a map has a mask - Object is child of smart object which also has a map (eg. transit) --> Masking did not apply to the children before this patch. NOTE: This works fine in SW but still didn't work in GL, see the following commit...
-rw-r--r--src/lib/evas/canvas/evas_render.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index a848a891ad..42a6e4bb3e 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1213,9 +1213,12 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1213 Eina_Bool use_mapped_ctx, Eina_Bool do_async) 1213 Eina_Bool use_mapped_ctx, Eina_Bool do_async)
1214{ 1214{
1215 void *ctx; 1215 void *ctx;
1216 Eina_Bool restore_image_clip = EINA_FALSE, old_use_clip = EINA_FALSE;
1217 int oldm_x = 0, oldm_y = 0, ocx = 0, ocy = 0, ocw = 0, och = 0;
1216 Evas_Object_Protected_Data *obj2; 1218 Evas_Object_Protected_Data *obj2;
1217 Eina_Bool clean_them = EINA_FALSE; 1219 Eina_Bool clean_them = EINA_FALSE;
1218 Eina_Bool proxy_src_clip = EINA_TRUE; 1220 Eina_Bool proxy_src_clip = EINA_TRUE;
1221 void *oldm_sfc = NULL;
1219 1222
1220 //Don't Render if the source is invisible. 1223 //Don't Render if the source is invisible.
1221 if (!proxy_render_data) 1224 if (!proxy_render_data)
@@ -1459,6 +1462,31 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1459 _evas_render_mapped_context_clip_set(e, eo_obj, obj, context, 1462 _evas_render_mapped_context_clip_set(e, eo_obj, obj, context,
1460 proxy_render_data, off_x, 1463 proxy_render_data, off_x,
1461 off_y); 1464 off_y);
1465
1466 /* Clipper masks */
1467 if (_evas_render_object_is_mask(obj->cur->clipper))
1468 {
1469 // This path can be hit when we're multiplying masks on top of each other...
1470 Evas_Object_Protected_Data *mask = obj->cur->clipper;
1471 if (mask->mask->redraw || !mask->mask->surface)
1472 evas_render_mask_subrender(obj->layer->evas, mask, obj->clip.prev_mask);
1473
1474 if (mask->mask->surface)
1475 {
1476 restore_image_clip = EINA_TRUE;
1477 e->engine.func->context_clip_image_get
1478 (e->engine.data.output, context,
1479 &oldm_sfc, &oldm_x, &oldm_y);
1480 old_use_clip = e->engine.func->context_clip_get
1481 (e->engine.data.output, context,
1482 &ocx, &ocy, &ocw, &och);
1483 e->engine.func->context_clip_image_set
1484 (e->engine.data.output, context,
1485 mask->mask->surface,
1486 mask->cur->geometry.x + off_x,
1487 mask->cur->geometry.y + off_y);
1488 }
1489 }
1462 } 1490 }
1463 } 1491 }
1464// if (surface == e->engine.data.output) 1492// if (surface == e->engine.data.output)
@@ -1476,6 +1504,17 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1476 obj->map->surface, obj->map->spans, 1504 obj->map->surface, obj->map->spans,
1477 obj->map->cur.map->smooth, 0, do_async); 1505 obj->map->cur.map->smooth, 0, do_async);
1478 } 1506 }
1507
1508 if (restore_image_clip)
1509 {
1510 if (old_use_clip)
1511 e->engine.func->context_clip_set(e->engine.data.output, context, ocx, ocy, ocw, och);
1512 else
1513 e->engine.func->context_clip_unset(e->engine.data.output, context);
1514 e->engine.func->context_clip_image_set
1515 (e->engine.data.output, context, oldm_sfc, oldm_x, oldm_y);
1516 }
1517
1479 // FIXME: needs to cache these maps and 1518 // FIXME: needs to cache these maps and
1480 // keep them only rendering updates 1519 // keep them only rendering updates
1481 // obj->layer->evas->engine.func->image_map_surface_free 1520 // obj->layer->evas->engine.func->image_map_surface_free
@@ -1494,10 +1533,6 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1494 1533
1495 if (mapped) 1534 if (mapped)
1496 { 1535 {
1497 Eina_Bool restore_image_clip = EINA_FALSE, old_use_clip = EINA_FALSE;
1498 int oldm_x = 0, oldm_y = 0, ocx = 0, ocy = 0, ocw = 0, och = 0;
1499 void *oldm_sfc = NULL;
1500
1501 RDI(level); 1536 RDI(level);
1502 RD(" draw child of mapped obj\n"); 1537 RD(" draw child of mapped obj\n");
1503 if (use_mapped_ctx) 1538 if (use_mapped_ctx)