Skip to content

Use BlurMaskFilter in outset shadows instead of Blur RenderEffect#45986

Closed
NickGerleman wants to merge 3 commits into
facebook:mainfrom
NickGerleman:export-D61162637
Closed

Use BlurMaskFilter in outset shadows instead of Blur RenderEffect#45986
NickGerleman wants to merge 3 commits into
facebook:mainfrom
NickGerleman:export-D61162637

Conversation

@NickGerleman
Copy link
Copy Markdown
Contributor

Summary:
This uses SkBlurMask under the hood, to draw geometry with blur, without going the route of full image filter/rasterization. It was not supported under hardware accelerated canvases for a while, but seems to fully work as of API 29.

Requiring Android 10 instead of 12 makes box shadows a lot more palatable (80% support vs 50%), and we see drastically better performance in one case with many large shadows, where creating many large hardware layers previously drastically hurt framerates.

{F1801807696}

At this point, the RenderNode may be redundant, though I think it can technically save us some work on redraws still. It is kept around for now. I simplified some of the math around here as well.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D61162637

Summary:
This adjusts logic to be similar to InsetBoxShadowDrawable to keep the full ink within RenderNode bounds. This avoids a tiny bit of overdraw, but also means we get correct rendering if RenderNode is promoted to a compositing layer.

Changelog: [Internal]

Differential Revision: D60972085
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Aug 12, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D61162637

NickGerleman and others added 2 commits August 12, 2024 16:49
Summary:
This is confusing, because styles layer deals with DIPs, conversion only happens when parsing dynamic, and `POINT` (the `LengthPercentageType`) also maps to DIPs instead of physical pixels.

Move conversion to physical pixels to drawing layer, so everything above `BackgroundStyleApplicator` works with `style` types which are all in DIPs.

Changelog: [Android][Breaking] Do not implicitly convert parsed LengthPercentage to pixels

Differential Revision: D60507151
…cebook#45986)

Summary:
Pull Request resolved: facebook#45986

This uses SkBlurMask under the hood, to draw geometry with blur, without going the route of full image filter/rasterization. It was not supported under hardware accelerated canvases for a while, but seems to fully work as of API 29.

Requiring Android 10 instead of 12 makes box shadows a lot more palatable (80% support vs 50%), and we see drastically better performance in one case with many large shadows, where creating many large hardware layers previously drastically hurt framerates.

{F1801807696}

At this point, the RenderNode may be redundant, though I think it can technically save us some work on redraws still. It is kept around for now. I simplified some of the math around here as well.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D61162637
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D61162637

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Aug 13, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 6c07106.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants