summaryrefslogtreecommitdiff
path: root/src/bin/edje/edje_cc_out.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-04-28 18:56:02 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-15 16:59:41 +0900
commit75ec3a7338c9c2406d4765a4cc8247f72d6bec7b (patch)
tree2ce20dfa89b036f5d5326eadb4d9026da27f8309 /src/bin/edje/edje_cc_out.c
parent02d825f116e3b791c784791b10cfe613c5f18385 (diff)
Edje: Add clip as a property of a part description
Since masking, for performance and themeing reasons, it becomes interesting to be able to switch clippers on the fly. In particular, switching from an IMAGE mask to a standard RECT clipper can save a lot of power when masking is not required. This new flag "description.clip_to" will behave a bit like a mix of rel.to and visible: - It points to a part by name, just like part.clip_to. This will override the clipper set by the part, or override the default clipper. - Like "visible", it can not be interpolated between two values, so it will switch only at the end of a transition. - By default there is no clip override, which means Edje will fallback to the part's clipper, if any, or the base (group's) clipper. NOTE: - Since a clipper that does not clip anything becomes a standard object, it is visible and rendered. This will in 99.999% cases not be the intended behaviour. Currently we can simply use a transparent RECT in order to always have something clipped by the clipper, but this is a hack and this will trigger rendering of masks in their surfaces even when they are not actually used. Ideally, there should be a flag indicating to Edje & Evas that an object should be considered a clipper in all situations, and never be rendered on screen. TODO: - Support Edje Edit - Add Embryo & Lua functions - Add support in edje_convert - Add Edje/Evas flag to mark objects as "no_render" @feature
Diffstat (limited to '')
-rwxr-xr-xsrc/bin/edje/edje_cc_out.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index 485aa8c0dc..78d3fab431 100755
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -465,6 +465,19 @@ check_nameless_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Descript
465} 465}
466 466
467static void 467static void
468check_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Description_Common *ed, Eet_File *ef)
469{
470 /* FIXME: When smart masks are supported, remove this check */
471 if (ed->clip_to_id != -1 &&
472 (pc->parts[ed->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE) &&
473 (pc->parts[ed->clip_to_id]->type != EDJE_PART_TYPE_IMAGE))
474 error_and_abort(ef, "Collection %i: description.clip_to point to a non RECT/IMAGE part '%s' !",
475 pc->id, pc->parts[ed->clip_to_id]->name);
476
477 check_nameless_state(pc, ep, ed, ef);
478}
479
480static void
468check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef) 481check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
469{ 482{
470 unsigned int i; 483 unsigned int i;
@@ -475,7 +488,7 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
475 "for part \"%s\"", pc->id, ep->name); 488 "for part \"%s\"", pc->id, ep->name);
476 489
477 for (i = 0; i < ep->other.desc_count; ++i) 490 for (i = 0; i < ep->other.desc_count; ++i)
478 check_nameless_state(pc, ep, ep->other.desc[i], ef); 491 check_state(pc, ep, ep->other.desc[i], ef);
479 492
480 if (ep->type == EDJE_PART_TYPE_IMAGE) 493 if (ep->type == EDJE_PART_TYPE_IMAGE)
481 { 494 {
@@ -490,7 +503,7 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
490 else if (ep->type == EDJE_PART_TYPE_GROUP) 503 else if (ep->type == EDJE_PART_TYPE_GROUP)
491 check_source_links(pc, ep, ef, group_path); 504 check_source_links(pc, ep, ef, group_path);
492 505
493 /* FIXME: When mask are supported remove this check */ 506 /* FIXME: When smart masks are supported, remove this check */
494 if (ep->clip_to_id != -1 && 507 if (ep->clip_to_id != -1 &&
495 (pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE) && 508 (pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE) &&
496 (pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_IMAGE)) 509 (pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_IMAGE))