Skip to content

lottie: Implement Set Matte(Matte3) effect#4300

Open
tinyjin wants to merge 1 commit into
mainfrom
jinny/fix-matte
Open

lottie: Implement Set Matte(Matte3) effect#4300
tinyjin wants to merge 1 commit into
mainfrom
jinny/fix-matte

Conversation

@tinyjin

@tinyjin tinyjin commented Apr 6, 2026

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings April 6, 2026 21:03
@tinyjin tinyjin self-assigned this Apr 6, 2026
@github-actions github-actions Bot added the lottie Lottie animation label Apr 6, 2026
@tinyjin tinyjin added the enhancement Improve features label Apr 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial support for the Lottie “Set Matte (Matte3)” layer effect to improve Lottie effects compliance (related to #4158), by parsing the effect and wiring it into the matte-building/rendering pipeline.

Changes:

  • Introduce a new LottieEffect::SetMatte type and model (LottieFxSetMatte) to store Matte3 properties.
  • Extend the Lottie parser to instantiate and parse the Set Matte effect.
  • Update the builder to derive matteTarget/matteType from Set Matte and adjust matte updating behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/loaders/lottie/tvgLottieParser.h Adds Set Matte parsing entry point declaration.
src/loaders/lottie/tvgLottieParser.cpp Instantiates LottieFxSetMatte and parses Matte3 properties.
src/loaders/lottie/tvgLottieModel.h Adds SetMatte effect type, LottieFxSetMatte struct, and a new layer flag.
src/loaders/lottie/tvgLottieBuilder.cpp Hooks Set Matte into composition building and adjusts matte application logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/loaders/lottie/tvgLottieBuilder.cpp
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieModel.h Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Copilot AI review requested due to automatic review settings April 7, 2026 03:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
@hermet hermet added the compliance Specification Compliance for W3C, Lottie, SVG, etc. label Apr 7, 2026
@tinyjin tinyjin marked this pull request as draft April 7, 2026 03:35
@tinyjin tinyjin force-pushed the jinny/fix-matte branch 2 times, most recently from bc12c80 to 58eda91 Compare April 7, 2026 04:51
@tinyjin tinyjin marked this pull request as ready for review April 7, 2026 09:26
Copilot AI review requested due to automatic review settings April 7, 2026 09:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieModel.h Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp
@tinyjin tinyjin requested a review from hermet April 7, 2026 09:41
@hermet hermet force-pushed the main branch 2 times, most recently from a00fdaa to 9bd7217 Compare April 7, 2026 12:26
@wenjieshen

wenjieshen commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Validation

Test file: lottie - 2026-04-07T060138.300.json is invalid. It could be uploaded again.

10624.json
16465.json
Work well.

FPS on the examples: Lottie, LottieBigSize, LottieExpressions keeps consistency.
Size: -160 Bytes.

I didn't find any observable issues during all examples execution.

Thank you for the contribution.

@hermet

hermet commented Apr 8, 2026

Copy link
Copy Markdown
Member

Size: -160 Bytes.

@wenjieshen It's very weird how size could be reduced with logic addition...

@tinyjin

tinyjin commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

@hermet @wenjieshen

Note, in my WASM comparison (main vs here), I got 524 bytes increased:
main: 924,538 bytes (903 KB)
fix-matte: 925,062 bytes (903 KB)

-> +524 bytes (+0.057%)

According to wasm-obj, the code section is the most increased part (+435B)

Copilot AI review requested due to automatic review settings April 9, 2026 16:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/loaders/lottie/tvgLottieModel.h Outdated
Comment thread src/loaders/lottie/tvgLottieParser.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
@hermet hermet requested a review from Nor-s as a code owner April 28, 2026 10:56
@hermet hermet force-pushed the jinny/fix-matte branch from 07410d1 to 2f0dae8 Compare May 11, 2026 03:44
@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown

Binary Size Report

Config main text main data PR text PR data Delta
arm64-clang 849,009 23,616 849,605 23,648 +628 (+0.07%)
x86-gcc 878,405 11,484 879,029 11,516 +656 (+0.07%)
x86_64-clang 853,852 22,120 854,520 22,152 +700 (+0.08%)
x86_64-gcc 859,609 21,880 860,263 21,912 +686 (+0.08%)

Comment thread src/loaders/lottie/tvgLottieParser.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
Copilot AI review requested due to automatic review settings May 27, 2026 14:18
@tinyjin tinyjin force-pushed the jinny/fix-matte branch from 2f0dae8 to d1312ff Compare May 27, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread src/loaders/lottie/tvgLottieModel.h Outdated
Comment thread src/loaders/lottie/tvgLottieBuilder.cpp Outdated
@tinyjin tinyjin force-pushed the jinny/fix-matte branch from d1312ff to 639022b Compare May 27, 2026 14:28
@tinyjin tinyjin requested a review from hermet May 27, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compliance Specification Compliance for W3C, Lottie, SVG, etc. enhancement Improve features lottie Lottie animation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants