You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decouple CSSBackgroundDrawable from OutsetBoxShadowDrawable (#45805)
Summary:
Pull Request resolved: #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]
Reviewed By: joevilches
Differential Revision: D60401423
fbshipit-source-id: 693d9bf5e85956290db932cdb18f15ba26446894
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/OutsetBoxShadowDrawable.kt
0 commit comments