Repository navigation
feat(android): draw backdrop-filter natively on SDK 37.2+ - #60208
Open
kagantemizkan wants to merge 2 commits into
Open
kagantemizkan wants to merge 2 commits into
kagantemizkan wants to merge 2 commits into
Conversation
On Android 17 QPR (SDK 37.2) RenderNode.setBackdropRenderEffect applies a RenderEffect to whatever is already drawn behind a node, on the RenderThread. Use it for backdropFilter when available and keep the bitmap snapshot path below 37.2. - No snapshot bitmap: the backdrop includes content outside the parent (sibling ScrollViews, ancestors), not only the parent's background and earlier siblings. - A ReactViewGroup draws the effect node in its own draw(), so it follows native-driver transform and opacity animations without the parent re-recording its display list. - The node is clipped to the view's outline (border radius) without clipToOutline on the view, so overflow: visible content is not clipped. - A view with only backdropFilter is no longer flattened away. The method is resolved by reflection because compileSdk is 37.0.
kagantemizkan
force-pushed
the
native-backdrop-37-2
branch
from
November 21, 2026 16:00
20d3d13 to
cc5d61b
Compare
3 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Android 17 QPR (SDK 37.2) adds
RenderNode.setBackdropRenderEffect/View.setBackdropRenderEffect: the platform applies aRenderEffectto whatever is already drawn behind a node, on the RenderThread. This PR uses it forbackdropFilterwhen available and keeps the bitmap snapshot path from #59141 on older versions.What the native path changes compared with the snapshot:
ScrollViewnow blurs the list as it scrolls.ARGB_8888allocation and no per-frame software redraw of siblings.ReactViewGroupdraws the effect node at the start of its owndraw(), so the node is part of the view's display list and inherits its transform, opacity and visibility, which native-driver animations change without re-recording the parent.RenderNodeclipped to the view's outline, sooverflow: visiblechildren are not clipped (putting the effect on the view itself would needclipToOutlineon the view).It also fixes two issues found while testing #59141:
ViewShadowNodenow treatsbackdropFilteras forming a view (likefilter). Before, a view whose only visual props werebackdropFilterandborderRadiuswas flattened away and nothing was filtered, on both paths.ReactSurfaceView, whereReactViewGroup.drawChildnever runs. On the native path the view draws its own backdrop, so the parent type doesn't matter. Below 37.2 the parent still draws it, as in feat: Add backdrop-filter support for Android #59141.Notes:
compileSdkis 37.0, which doesn't have it. It is gated onBuild.VERSION.SDK_INT_FULL >= 37.2; on older versions nothing changes. OncecompileSdkis 37.2 or later the reflection can be replaced by a direct call.Changelog:
[ANDROID] [ADDED] - Draw
backdropFilterwith the platform backdrop API on Android 17 QPR (SDK 37.2) and laterTest Plan:
RNTester
BackdropFilterExamplefrom #59138 plus extra cases, on an Android 17 QPR emulator (Google APIs 16 KB page size image,ro.build.version.sdk_full=37.2), new architecture.All filter functions from #59138's examples render on the native path.
Screenshots (SDK 37.2 emulator, native path):
borderRadius: 30(left: no filter, right:blur(10px))blur(2px),blur(4px),blur(8px)withborderRadius: 40borderRadius+ child overflowing withoverflow: visible: backdrop clipped, child notopacity: 0.5/backgroundColor: rgba(255,255,255,0.4)on topView over a sibling
ScrollView, before and after scrolling (snapshot path: no blur here)Animatedtranslate + scale with the native driver, 0.7 s apart (snapshot path: stays in place)Not tested: real SDK 37.2 hardware (none available yet),
SurfaceView/TextureViewcontent behind the view, RTL.