Skip to content
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

Replace SurfaceView with TextureView #142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Yaski
Copy link

@Yaski Yaski commented Oct 13, 2024

It works but is not optimal because I have to create a new Surface every time SurfaceTexture changes. I have to convert to Surface because the native methods in webgpu only accept input as Surface.
Because of this there is flickering in "Resize" example.

@wcandillon
Copy link
Owner

@Yaski Thank you for this PR, we're considering other approaches for transparency on Android, stay tuned.

@wcandillon
Copy link
Owner

It doesn't solve the issue right? I'm currently investigating this topic.

@Yaski
Copy link
Author

Yaski commented Oct 19, 2024

@wcandillon using TextureView solves issue with black background. Are you mentioning some other issue?
And I tried to make background transparent and I couldn't for some reason.

@wcandillon
Copy link
Owner

@Yaski I've done more testing and we are shipping transparency on iOS now. For Android, the current plan will be to keep surface view as the default, offer TextureView via a prop (named <Canvas androidTransparency /> or something) and for Android 29 and above, use an Android hardware buffer. Please bare with us as we work on these issues.

@wcandillon
Copy link
Owner

@Yaski Thank you for your implementation. We are offering transparency via the androidTransparency. Right now we offer SurfaceView (opaque), TextureView (animates slower), and AHB (API Level => 29, animates faster but resizing is slightly slower at the moment. I am thinking of releasing first just the SurfaceView and Texture implementation and enable the AHB implementation later.

I am closing this in favor of #168

@wcandillon wcandillon mentioned this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants