Introduce "BoxShadowDrawable" for Android box shadows
Summary
This change adds a drawable, when when drawn on the bounds of a border-box sized view, will draw a spec compliant box-shadow outside the box. This is reliant on Android RenderNode and RenderEffect APIs provided by API 31.
Inset box shadows can also be added using a similar method, but this is not done yet.
The code which manages this is in flux, but the underlying drawable should be good. Will add some tests once it's more wired up.
Test Plan
Below applies a 5px black spread with a 10px blur to the purple view which includes a border radius. Other combinations of offsets, spreads, and blur radii were tested.
When I did this inside of the existing filters test (top has filter applied), it highlighted an issue of clipping content outside of filtered area, which will not be related directly to this change.
Changelog: [Internal]
Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 19,385,272 | +11 |
| android | hermes | armeabi-v7a | n/a | -- |
| android | hermes | x86 | n/a | -- |
| android | hermes | x86_64 | n/a | -- |
| android | jsc | arm64-v8a | 22,760,270 | +6 |
| android | jsc | armeabi-v7a | n/a | -- |
| android | jsc | x86 | n/a | -- |
| android | jsc | x86_64 | n/a | -- |
Base commit: 1b152f6ecada320602b45ea435f57e9ffc112932 Branch: main
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request was exported from Phabricator. Differential Revision: D55561465
This pull request has been merged in facebook/react-native@314a919df65a223cfa142b974b3db515f965e05e.