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
Fix bug where offscreen layers would erroneously draw black pixels (#55762)
Summary:
Pull Request resolved: #55762
On API <= 28, `clipWithAntiAliasing` uses `saveLayer` for anti-aliased border radius clipping. When a view is partially off-screen, the GPU only renders into the visible portion of the `saveLayer` buffer, leaving off-screen pixels as opaque black. These black pixels survive Porter-Duff compositing and appear as visible artifacts.
Adding `canvas.clipRect(0, 0, view.width, view.height)` before `saveLayer` forces HWUI to properly initialize the offscreen buffer relative to the GPU scissor. The clip is in local coordinates, so it stays correct across parent transform animations and scrolling offsets.
Changelog: [Internal]
Reviewed By: NickGerleman, jorge-cab
Differential Revision: D94447724
fbshipit-source-id: cb8470a00ca489a79779fe9b8e4f200c39f83284
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt
0 commit comments