Skip to content

Decouple CSSBackgroundDrawable from OutsetBoxShadowDrawable#45805

Closed
NickGerleman wants to merge 1 commit into
facebook:mainfrom
NickGerleman:export-D60401423
Closed

Decouple CSSBackgroundDrawable from OutsetBoxShadowDrawable#45805
NickGerleman wants to merge 1 commit into
facebook:mainfrom
NickGerleman:export-D60401423

Conversation

@NickGerleman
Copy link
Copy Markdown
Contributor

Summary:
After recent changes where we dive into paths ourselves, we really don't have a good reason to use the heavy CSSBackgroundDrawable. Accept a box shadow style in place of a reference to the original drawable, and then draw using calculated round rect path instead of new whole Drawable. This lets us avoid a lot of conversions as well (with the last diff already removing some).

Changelog: [Internal]

Differential Revision: D60401423

@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 Jul 29, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

…#45805)

Summary:
Pull Request resolved: facebook#45805

After recent changes where we dive into paths ourselves, we really don't have a good reason to use the heavy CSSBackgroundDrawable. Accept a box shadow style in place of a reference to the original drawable, and then draw using calculated round rect path instead of new whole Drawable. This lets us avoid a lot of conversions as well (with the last diff already removing some).

Changelog: [Internal]

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

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

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Aug 8, 2024
…#45805)

Summary:
Pull Request resolved: facebook#45805

After recent changes where we dive into paths ourselves, we really don't have a good reason to use the heavy CSSBackgroundDrawable. Accept a box shadow style in place of a reference to the original drawable, and then draw using calculated round rect path instead of new whole Drawable. This lets us avoid a lot of conversions as well (with the last diff already removing some).

This should also resolve a crash we started seeing:

```
androidx.core.util.Preconditions.checkNotNull (Preconditions.java:136) [inlined]
- com.facebook.react.uimanager.drawable.CSSBackgroundDrawable.drawRoundedBackgroundWithBorders (CSSBackgroundDrawable.java:386)
 [inlined]
- com.facebook.react.uimanager.drawable.CSSBackgroundDrawable.draw (CSSBackgroundDrawable.java:142)
- com.facebook.react.uimanager.drawable.OutsetBoxShadowDrawable.draw (OutsetBoxShadowDrawable.kt:137)
- android.graphics.drawable.LayerDrawable.draw (LayerDrawable.java:1019)

```

Changelog: [Internal]

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

This pull request has been merged in d56d9d9.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Aug 8, 2024
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @NickGerleman in d56d9d9

When will my fix make it into a release? | How to file a pick request?

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.

3 participants