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

[Impeller] Do SourceOver alpha compositing for advanced blends; write results to the pass with kSource #36658

Merged
merged 2 commits into from
Oct 8, 2022

Conversation

bdero
Copy link
Member

@bdero bdero commented Oct 7, 2022

Fixes flutter/flutter#110672.

This fixes the major issue found in #36656:

Jonah's test app (left is Skia, right is Impeller):
Screen Shot 2022-10-07 at 2 44 31 AM

2 remaining issues:

  • Modulate is definitely wrong.
  • Linear sampling needs to be offset by half a texel (notice the light colored pixel line above the image).

@bdero bdero self-assigned this Oct 7, 2022
@bdero bdero changed the title [Impeller] Do SourceOver alpha blending in advanced blends -- blit results to the pass with kSource [Impeller] Do SourceOver alpha compositing for advanced blends; write results to the pass with kSource Oct 7, 2022
@bdero
Copy link
Member Author

bdero commented Oct 7, 2022

Verified that this doesn't regress gskinnerTeam/flutter-wonderous-app#34.

image


frag_color = vec4(blended, 1) * src.a * dst.a;
frag_color = mix(dst_sample, blended, src.a);
//frag_color = dst_sample;
Copy link
Member

Choose a reason for hiding this comment

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

No commented out code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@jonahwilliams
Copy link
Member

You'll need to pull latest to get the framework tests to compile

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM (with Zach's nit fixed)

@bdero bdero force-pushed the bdero/fix-advanced-blend-alpha branch from a0e93c8 to 75091a7 Compare October 8, 2022 02:46
@bdero bdero merged commit 6967c35 into flutter:main Oct 8, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
3 participants