The ART '<Surface>' becomes invisible in Android
See original GitHub issueIs this a bug report?
Yes.
Have you read the Contributing Guidelines?
Yes.
Environment
Environment: OS: macOS Sierra 10.12.6 Node: 8.4.0 Yarn: 1.3.2 Watchman: 4.9.0
Packages: (wanted => installed) react-native: 0.50.1 => 0.50.1 react: 16.0.0 => 16.0.0
Target Platform: Android 7.1.1
Steps to Reproduce
- generate a pathh and draw if with ART, it works correctly on the first render;
- put the phone to sleep;
- awake the phone;
- the
<Surface>
area becomes invisable;
Expected Behavior
it should just look like same with the first render.
Actual Behavior
the <Surface>
area becomes invisable;
Reproducible Demo
the main just like below:
<Surface width={ 300 } height={ 200 }>
<Shape d={ new Path()
.moveTo(0, 0)
.lineTo(0, 200)
.lineTo(300, 200)
.lineTo(300, 0)
.close() } fill={ '#f00' } />
</Surface>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:28 (7 by maintainers)
Top Results From Across the Web
The ART Surface becomes invisible in Android - YouTube
The ART Surface becomes invisible in Android. 23 views Dec 18, 2018 this is screen record for pull request #22624 in react-native repo...
Read more >GL Surface and Visibility: Gone - android - Stack Overflow
The surface is in an invisible RelativeLayout (visibility: gone). When I change the visibility to "visible" then back to "gone", the layout ...
Read more >SurfaceView | Android Developers
The transparent region that makes the surface visible is based on the layout positions in the view hierarchy. If the post-layout transform properties...
Read more >Why is Waze now defaulting to Invisible Mode? It's happening ...
Why is Waze now defaulting to Invisible Mode? It's happening on iPhone and Android. Getting real tired of having to manually change ...
Read more >Map artwork over 3D objects in Illustrator - Adobe Support
To view only the artwork map without the geometry of a 3D object, select Invisible Geometry in Properties. You can use this effect...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I solved this problem by modifying the implementation of ART on Android Native Code. The code changes very little. Use View instead of SurfaceView or TextureView
Potential risk: Texurate used to be rendered in sub threads, and View is now in the main thread. But testing, it has almost no effect on rendering speed.
code: com.facebook.react.views.art.ARTSurfaceView.java :
com.facebook.react.views.art.ARTSurfaceViewShadowNode.java :
com.facebook.react.views.art.ARTSurfaceViewManager.java :
Results from an internal investigation here:
It sounds like the best path forwards may be to switch from TextureView to SurfaceView since the latter appears intended for software drawing which is what we’re doing (vs video/camera use cases recommended in TextureView docs).
It’s not clear if we’ll have time to work on this at FB soon but if someone in the community wants to try their hand at making the switch then that would be valuable towards getting this bug fixed.
cc @himabindugadupudi