-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android: Adjust border radius to maximum of half the smallest side #17514
Conversation
These test failures are unrelated to this pull request. include_defs("//ReactCommon/DEFS") |
@yedidyak I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
Looks good to me, @janicduplessis and @emilsjolander would you mind looking at this? |
For the test failures, please rebase your branch as the master is passing :) |
Does it also work when setting a specific corner border radius like bottomLeftBorderRadius? I find the bug kind of weird though, would prefer to find what is actually causing the high memory usage. Have you tried looking at what the path we are drawing looks like to make sure that is ok? |
I rebased, thanks. @janicduplessis The end result looked correct, but the bounds of the ReactViewBackgroundDrawable expanded to huge numbers in all directions. I tried to analyse what was happening to cause that, I don't remember exactly what I found but the algorithm simply doesn't expect larger than possible border radii. |
@RSNara Any idea about what the best fix would be here since you are the last one to have worked on this? :) |
@janicduplessis Whatever is the issue with the underlying algorithm, limiting the borderRadius to the maximum possible size is still worthwhile, no? |
@janicduplessis @grabbou bump |
After upgrading to React-Native 0.54 our app becomes so slow on because of this issue. |
@yedidyak I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
@janicduplessis @grabbou bump? |
I'll leave the final word to @janicduplessis as he seemed to be more active than me in this thread. |
@janicduplessis can you please have a look? |
+1 |
I'm not sure, but I think this PR can be closed, as the issue #17267 has been fixed which might be the root cause. |
Motivation
Currently, if a View has a border radius set to larger than the size of the View, and there s a borderWidth set, there is a very serious performance problem on Android.
Test Plan
This can be verified easily by making any view with a thin border, and watching the Android GPU performance or memory as it is rendered. Native memory allocation will immediately max out, and the GPU render profiler will look like this:
Memory:
With the fix, these problems disappear.
Release Notes
[ANDROID] [BUGFIX][View] - Treat larger than possible border radius as meaning 50% of the smallest side