Page MenuHomePhabricator

vg_json: Set multiple mask from json
ClosedPublic

Authored by jsuya on Mar 28 2019, 10:39 PM.

Details

Reviewers
Hermet
Summary

This patch supports multiple masks for multiple attributes on a layer.
Make main_mask_layer and make each mask EFL_CANVAS_VG_CONTAINER_CLASS and connect them.
main_mask_layer is made for masks
The masks are composited into main_mask_layer in order.
main_mask_layer exists for the intersect option in last order
This can be optimized later, and is created and used temporarily in this patch.

Test Plan

If there are three masks, they can be created as below.
mask_set(clayer, main_mask);
mask_set(main_mask, mask_1);
mask_set(mask_1, mask_2);
mask_set(mask_2, mask_3);

Diff Detail

Repository
rEFL core/efl
Branch
devs/hermet/lottie
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10913
Build 8485: arc lint + arc unit
jsuya created this revision.Mar 28 2019, 10:39 PM
jsuya requested review of this revision.Mar 28 2019, 10:39 PM
jsuya planned changes to this revision.Mar 31 2019, 11:58 PM
jsuya updated this revision to Diff 21131.Apr 2 2019, 3:55 AM

update commit

Hermet requested changes to this revision.Apr 2 2019, 5:11 AM

please check a comment.

src/static_libs/vg_common/vg_common_json.c
28

Please consider this offset is necessary... I don't see any point here.

This revision now requires changes to proceed.Apr 2 2019, 5:11 AM
jsuya updated this revision to Diff 21230.Apr 4 2019, 11:11 PM

remove unnecessary code

jsuya updated this revision to Diff 21231.Apr 4 2019, 11:13 PM

update code

Hermet requested changes to this revision.Apr 11 2019, 6:10 PM

Please check comments.

src/static_libs/vg_common/vg_common_json.c
256

unnecessary casting ((float) 255)

299

Let keep code consistency..
parent_layer => mtarget (mask target)
mask_layer -> msource; (mask source)

302

//make main_mask_layer /* ?

307

mask_layer = efl_add(EFL_CANVAS_VG_CONTAINER_CLASS, ctree);

309

default is visible, don't need to call this.

320

int => size_t

337

In point of assembly code,
Rather than call functions every cases, It'd be better if using a variable and call the function lastly.
ex)
switch (mask_mode)

case MaskAdd:
    mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD;
    break;
case MaskSubtract:
    mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUB;
    break;

...
efl_canvas_vg_node_mask_set(mask_layer, mask_mode);

See how matte_mode does.

This revision now requires changes to proceed.Apr 11 2019, 6:10 PM
jsuya marked 7 inline comments as done.Apr 17 2019, 12:11 AM
jsuya added inline comments.
src/static_libs/vg_common/vg_common_json.c
320

i will change int to unsigned int like other code.

jsuya updated this revision to Diff 21392.Apr 17 2019, 12:12 AM
jsuya marked an inline comment as done.

update code :)

Hermet requested changes to this revision.Apr 17 2019, 6:07 PM

Please check comments.

src/static_libs/vg_common/vg_common_json.c
256

My first intention is
int g = (int) (255.0f * pa);

simple liner.

334

typo?

This revision now requires changes to proceed.Apr 17 2019, 6:07 PM
jsuya updated this revision to Diff 21439.Apr 17 2019, 6:17 PM

modify code

jsuya updated this revision to Diff 21440.Apr 17 2019, 6:18 PM

fix typo

Hermet accepted this revision.Apr 17 2019, 6:21 PM
This revision is now accepted and ready to land.Apr 17 2019, 6:21 PM
Hermet closed this revision.Apr 17 2019, 6:23 PM