-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Fix alpha management issues for advanced blends. #50070
[Impeller] Fix alpha management issues for advanced blends. #50070
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
24e89f0
to
8a7c6aa
Compare
5d8f639
to
7da9005
Compare
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This is close but the composite still isn't quite right, a subset of the advanced blends look like the output color is getting doubled up. Working on fixing it. |
Fixed that issue and discovered a few new ones while combing through:
Investigating those now. The CPU mismatches need to be fixed now because they need to exactly match up otherwise there may be color jumps when the clear color optimization kicks in. But I think the saturation/color/luminosity differences with Skia are preexisting. Pretty sure I know what's going on there though. |
Okay figured out the cause of the CPU differences for ColorDodge/ColorBurn. Problem was CPU-side. |
Golden file changes are available for triage from new commit, Click here to view. |
Golden file changes are available for triage from new commit, Click here to view. |
The remaining issues w.r.t. the appearance of the source image vertical strips are fixed! |
…142425) flutter/engine@f3d48be...f15cb86 2024-01-29 [email protected] Revert Dart to Version 3.4.0-82.0.dev (flutter/engine#50131) 2024-01-28 [email protected] Roll Dart SDK from 639cf51f4472 to 1d0b890287a4 (1 revision) (flutter/engine#50129) 2024-01-28 [email protected] Roll Skia from 40205cafdb4e to d81204e28dcb (1 revision) (flutter/engine#50127) 2024-01-28 [email protected] Roll Fuchsia Linux SDK from GBTh3gOOgmndwT70X... to 5aijurFz23iIuRaMQ... (flutter/engine#50126) 2024-01-28 [email protected] [Impeller] Fix alpha management issues for advanced blends. (flutter/engine#50070) 2024-01-28 [email protected] Roll Skia from 0c1e352e87aa to 40205cafdb4e (1 revision) (flutter/engine#50124) 2024-01-27 [email protected] Roll Dart SDK from 422d048880a8 to 639cf51f4472 (1 revision) (flutter/engine#50123) 2024-01-27 [email protected] Revert "[Windows] Introduce `egl::Surface` and `egl::WindowSurface`" (flutter/engine#50104) 2024-01-27 [email protected] Roll Dart SDK from d0b48a008559 to 422d048880a8 (1 revision) (flutter/engine#50121) 2024-01-27 [email protected] Roll Skia from b9b80230c87b to 0c1e352e87aa (1 revision) (flutter/engine#50120) 2024-01-27 [email protected] Roll Dart SDK from 141ab6c14cd1 to d0b48a008559 (1 revision) (flutter/engine#50119) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from GBTh3gOOgmnd to 5aijurFz23iI If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Resolves flutter/flutter#140970.
The issue is easy to miss in the goldens if you don't know what to look for, but it was always present in one way or another. In the "before" image below, we end up removing some of the backdrop alpha as a result of the blend, which should never happen with an advanced blend:
This was happening because we were lerping towards the original source alpha from the destination alpha. So in the sad smiley case, the RGB getting written to the framebuffer was exactly correct, but the alpha would end up being less than 1, which the window manager then blends against the black-initialized framebuffer.
Blending with the black background just so happened to perfectly match the appearance of the color being double-premultiplied, which is why increasing the source color's vibrancy by unpremultiplying also looks correct. But again, that only works iff the pass texture winds up being drawn to a black background, which is a rare case for offscreen passes.
Skia (Flutter documentation):

Impeller before:

Impeller after:
