This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Impeller] Add ColorBurn, fix SourceOver alpha, make default pipeline initialization robust #33289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In addition to adding ColorBurn and activating advanced blends in the display list dispatcher, this change fixes pipeline alpha blend/default initialization problems that were resulting in double-premultiplied alpha for the SourceOver (default) Entities blend mode. This issue is difficult to notice in isolation, but rapidly compounds with overlapping transparent objects.
SourceOver
. The advanced blend shaders just manipulate color channels and pass the source alpha onward for blending. This makes the alpha channel affect the resulting color in the correct way.Screen
andColorBurn
in the display list dispatcher.ContentContextOptions
options. The default pipeline blend options no longer matchedkSourceOver
(the default entities blend mode). Rather than continuing to sync the default pipeline descriptor in the render layer, it's more robust to just apply the same Entities-specificContentContextOptions
transform to the pipeline descriptor in all cases where a new pipeline is created.Screen.Recording.2022-05-11.at.10.33.52.PM.mov
All blend modes now closely match this example: https://fiddle.skia.org/c/@BlendModes
Compare with the previous video I recorded of this test, where a dark outer ring can be seen around the color wheel due to the alpha compositing issues.