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
Use DeferredRenderer on Android #1483
Use DeferredRenderer on Android #1483
Conversation
Build on travis worked: https://travis-ci.org/AvaloniaUI/Avalonia/builds/364645293 |
@@ -27,6 +27,8 @@ public AvaloniaView(Context context) : base(context) | |||
AddView(_view.View); | |||
_root = new EmbeddableControlRoot(_view); | |||
_root.Prepare(); | |||
if (AndroidPlatform.UseDeferredRendering) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right place for starting the renderer. On desktop it's done form platform-independent classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are also aren't stopping the renderer, so it gets GC-rooted from the render loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's also why popups doesn't work, they aren't using AvaloniaView, since AvaloniaView is just a wrapper on top of our toplevel.
Another problem is that the render loop is ticking on non-UI thread and you haven't taken any thread-safety measures in TopLevelImpl.Lock() and AndroidFramebuffer.cs. See |
I moved the start/stop renderer calls to better positions in code, but i really dont know how do fix the thread safety issues. The other problem is that the popups are not shown - i think the surface is drawn on them - something with the z-order but i dont know how to fix this either. Sorry - i normally dont do much with android and/or deep graphic development. The positive news are - the ControlCatalog (and my app also) does run fast and useable with this fixes applied ;) |
You should probably start/stop renderer from TopLevelImpl itself. Or at least propagate some events from there. Popups aren't rendered because they are using TopLevelImpl directly, so there is nothing to start the renderer for them, I think. |
This has been inactive for nearly 2 years so going to close it. Please re-open if work on it continues. |
Some fixes for #1470 by using the DeferredRenderer - But PopupImpl does not seem to work