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

Anti-alias the edges of masks and mattes for a smoother result. #176

Merged
merged 2 commits into from
Oct 30, 2019

Conversation

simeoncran
Copy link
Contributor

The default BorderMode for Visuals is Inherit, and if not specified the value Hard (i.e. not anti-aliased) is passed into the root.
The default worked for us previously because the desktop tree sets the BorderMode to Soft and we inherit it so we got Soft behavior everywhere.
However the trees created for masks and mattes are not rooted in the desktop, so they were getting set to Hard and some edges looked aliased.

This change adds the ability to set the BorderMode and sets it to Soft for the trees created for masks and mattes.

The default BorderMode for Visuals is Inherit, and if not specified the value Hard (i.e. not anti-aliased) is passed into the root.
The default worked for us previously because the desktop tree sets the BorderMode to Soft and we inherit it so we got Soft behavior everywhere.
However the trees created for masks and mattes are not rooted in the desktop, so they were getting set to Hard and some edges looked aliased.

This change adds the ability to set the BorderMode and sets it to Soft for the trees created for masks and mattes.
@@ -670,9 +670,21 @@ Visual TranslateAndApplyMasks(TranslationContext context, ReadOnlySpan<Mask> mas
// the visual we want captured by the visual surface has a parent to use as the
// origin of its offsets.
var sourceIntermediateParent = _c.CreateContainerVisual();

// Because this the root of a tree, the BorderMode is not inherited and
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo, here and below. #Closed

@@ -16,6 +16,10 @@ private protected Visual()
{
}

// Defaults to Inherit. For trees rooted are set to Soft.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo #Closed

Copy link
Contributor

@eliezerpMS eliezerpMS left a comment

Choose a reason for hiding this comment

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

:shipit:

@simeoncran simeoncran merged commit f2a026c into master Oct 30, 2019
@delete-merged-branch delete-merged-branch bot deleted the SmoothMatteEdges branch October 30, 2019 04:53
@michael-hawker michael-hawker added this to the 6.0 milestone Nov 13, 2019
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.

None yet

3 participants