Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

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

Merged
bdero merged 2 commits intoflutter:mainfrom
bdero:bdero/fix-advanced-blend-alpha
Oct 8, 2022
Merged

[Impeller] Do SourceOver alpha compositing for advanced blends; write results to the pass with kSource#36658
bdero merged 2 commits intoflutter:mainfrom
bdero:bdero/fix-advanced-blend-alpha

Conversation

@bdero
Copy link
Contributor

@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
Contributor 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
Contributor 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
Contributor

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

Copy link
Contributor

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

[Impeller] Fidelity pass on ColorFilter blend modes.

3 participants