Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for gradients with alpha components #1640

Merged
merged 6 commits into from
Jul 11, 2022
Merged

Conversation

calda
Copy link
Member

@calda calda commented Jul 8, 2022

This PR improves support for gradients with alpha components. Fixes #1636.

The implementation in #1634 supported simple cases, but didn't support cases where the RGB components and alpha components had different color stops (not supported in a single CAGradientLayer). The main thread engine works around this by rendering two different gradients -- one for the RGB color components, and another for the alpha components that masks the color gradient. This PR adopts that technique for the Core Animation rendering engine.

Before After
Simulator Screen Shot - iPhone 8 - 2022-07-08 at 10 44 18 Simulator Screen Shot - iPhone 8 - 2022-07-08 at 10 42 50

Copy link
Collaborator

@erichoracek erichoracek left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@calda calda merged commit 02128d8 into master Jul 11, 2022
@calda calda deleted the cal--issue-1636 branch July 11, 2022 18:13
MoroziOS pushed a commit to MoroziOS/tmg-lottie-ios that referenced this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Core Animation rendering engine doesn't support gradients with complex alpha value locations
2 participants