-
Notifications
You must be signed in to change notification settings - Fork 24.1k
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
Two ReactART TODOs implemented on Android #9486
Conversation
Update from original
By analyzing the blame information on this pull request, we identified @spicyj and @emilsjolander to be potential reviewers. |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
@tepamid updated the pull request - view changes |
@tepamid updated the pull request - view changes |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@tepamid updated the pull request - view changes |
@tepamid updated the pull request - view changes |
Summary: Fix regression of rnpm/rnpm-plugin-link#88. Closes facebook#9252 Differential Revision: D3680785 fbshipit-source-id: a6ea63295ae8f61b17c0a1b2ca5e6a5f5da7437a
Summary: `this` is a `ReactNativeHost` post RN 0.29, so the current patch doesn't compile. Simply `getResources()` will work for all versions - Post RN 0.29, it will be the method in the outer `MainApplication`, Pre RN 0.29, it will be the method on the `MainActivity`. grabbou Kureev Closes facebook#9381 Differential Revision: D3744162 fbshipit-source-id: 1fa270bb3268b7b40c6160da948d99ff993c83b1
Summary: React 15.3.0 was officially released. We especially should try not depend on RCs in RN releases and npm doesn't handle RC versions well. Closes facebook#9279 Differential Revision: D3683587 fbshipit-source-id: fc4f8a030769232b7697434a419e1e07e482e308
fbshipit-source-id: 0373b4dd11895f3b1c76a904a0a59b70aaa845f9
fbshipit-source-id: c25ad1b942e75d9a631134fc277306931c7bc859
Reviewed By: davidaurelio Differential Revision: D3683793 fbshipit-source-id: 6ffb8c24e81cfb33b11b9f99d440220287161fb6
Hey, what's the status of this? |
I'm trying this code, and it seems that despite calling |
@tepamid updated the pull request - view changes |
@tepamid updated the pull request - view changes |
@tepamid did you get rid of the random |
@tepamid updated the pull request - view changes |
@foghina I couldn't reproduce IllegalArgumentException myself, the code works fine. However in our production exception trackers (Raygun and Google Analytics) I rarely see that some users do face IllegalArgumentExceptions. Even more strange is that there are cases when the Surface is valid and can be successfully locked before drawing, but after drawing while unlocking the Surface IllegalArgumentException is thrown. I googled this case and found a "holy-war" in stackoverflow whether adding try-catch around Surface locking-unlocking is a dirty hack or a reliability necessity. I personally tend to think it's a hack, but otherwise the app crashes which is even worse. Finally, I ended with adding try-catch to handle random IllegalArgumentExceptions. |
@tepamid nice, thanks for the summary. Do you know what happens when you catch? Does the app end up in a bad state, or does the next draw go through correctly? |
@foghina before I had a synthetic testcase which reproduced IllegalArgumentException in drawing on ARTSurface. An exception happened when I navigated between app screens and the screen containing ARTSurfare was unmounted. I suspect that native Android TextureView can be unmounted during drawing process putting surface handle (i.e. Canvas or Surface) into an invalid state even after the surface had been previously locked. So there won't be any more render cycles for this unmounted component and therefore lockCanvas attempts. Also exceptions occur either in lockCanvas or unlockCanvas methods. And not during drawing shapes on a canvas. |
Cool, thanks for the explanation! I'll go ahead and try to land this. |
Thanks for importing. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Implemented 2 TODOs from ReactART for Android: - TODO(7255985): Use TextureView and pass Surface from the view to draw on it asynchronously instead of passing the bitmap (which is inefficient especially in terms of memory usage) - TODO(6352067): Support dashes in ARTShape We use ReactNativeART in our Android project. 1. Our app crashes sometimes on large screen smartphones with OutOfMemoryError. Crashes happen in ARTSurfaceShadowNode where TODO(7255985) was suggested in a comment in order to use memory more efficiently. 2. We needed dashes for drawing on ARTSurface. **Test plan (required)** I attach a screenshot of our app which shows dashed-lines and two ARTSurfaces on top of each other rendering exactly the same as in the pervious implementation of ARTSurface. ![screenshot_2016-08-19-16-45-43](https://cloud.githubusercontent.com/assets/18415611/17811741/cafc35c4-662c-11e6-8a63-7c35ef1c5ba9.png) Closes #9486 Differential Revision: D4021303 Pulled By: foghina
Summary: Implemented 2 TODOs from ReactART for Android: - TODO(7255985): Use TextureView and pass Surface from the view to draw on it asynchronously instead of passing the bitmap (which is inefficient especially in terms of memory usage) - TODO(6352067): Support dashes in ARTShape We use ReactNativeART in our Android project. 1. Our app crashes sometimes on large screen smartphones with OutOfMemoryError. Crashes happen in ARTSurfaceShadowNode where TODO(7255985) was suggested in a comment in order to use memory more efficiently. 2. We needed dashes for drawing on ARTSurface. **Test plan (required)** I attach a screenshot of our app which shows dashed-lines and two ARTSurfaces on top of each other rendering exactly the same as in the pervious implementation of ARTSurface. ![screenshot_2016-08-19-16-45-43](https://cloud.githubusercontent.com/assets/18415611/17811741/cafc35c4-662c-11e6-8a63-7c35ef1c5ba9.png) Closes facebook#9486 Differential Revision: D4021303 Pulled By: foghina
Mirror ReactNativeART facebook/react-native#9486
Mirror ReactNativeART facebook/react-native#9486
Implemented 2 TODOs from ReactART for Android:
We use ReactNativeART in our Android project.
Test plan (required)
I attach a screenshot of our app which shows dashed-lines and two ARTSurfaces on top of each other rendering exactly the same as in the pervious implementation of ARTSurface.
![screenshot_2016-08-19-16-45-43](https://cloud.githubusercontent.com/assets/18415611/17811741/cafc35c4-662c-11e6-8a63-7c35ef1c5ba9.png)