Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit d80cb15 Author: Guilherme Iscaro <[email protected]> Date: Wed Dec 12 18:56:08 2018 -0200 ARTSurfaceViewShadowNode: Avoid not drawing the Surface View Calls updateExtraData(), which registers the surface texture listener may arrive too late, thus the SurfaceTexture may already have been created which will case onSurfaceTextureAvailable() to never be called, ultimatilly causing the surface to not be drawed. As a fix this patch checks if the SurfaceTexture is ready to use and if so draw the surface right away. commit c767175 Author: Guilherme Iscaro <[email protected]> Date: Wed Dec 12 18:45:55 2018 -0200 ARTSurfaceViewShadowNode: redraw itself if the host resumed the execution Starting on API level 25, Android will destroy the TextureView's TextureLayer when the an app is sent to the background and automatically create a new one once the TextureView is drawed again. This causes a problem for ARTSurfaceView, because this component does not draw itself and the Android API explicitly forbids to do such action. Since there's no listeners available to know when the new TextureLayer was created, the ARTSufurfaceViewShadowNode will listen for life cycle events and redraw its children once the activity is resumed. It's was also discussed that ARTSurfaceView should extends SurfaceView and not TextureView, however this may introduce two problems: * SurfaceView is not hardware accelerated, which may cause impact on performance * SurfaceView does not support opacity, so it will be impossible to set the ARTSufraceView as transparent With this problems in mind, this commit keeps the ARTSurfaceView extending TextureView. Fixes facebook#17565 commit 793669f Author: Guilherme Iscaro <[email protected]> Date: Wed Dec 12 18:43:54 2018 -0200 ARTSurfaceViewShadowNode: Properly release mSurface Since onSurfaceTextureDestroyed() returns true, the SurfaceTexture object will be released by the Android automatically so there's no need to call release on it. However, the node should release its refereces to the Surface object.
- Loading branch information