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

Use DeferredRenderer on Android #1483

Closed
wants to merge 5 commits into from
Closed

Use DeferredRenderer on Android #1483

wants to merge 5 commits into from

Conversation

inf9144
Copy link

@inf9144 inf9144 commented Apr 10, 2018

Some fixes for #1470 by using the DeferredRenderer - But PopupImpl does not seem to work

@inf9144
Copy link
Author

inf9144 commented Apr 10, 2018

Build on travis worked: https://travis-ci.org/AvaloniaUI/Avalonia/builds/364645293
Isnt being shown here because i updated the branch while it started the first build ....

@grokys
Copy link
Member

grokys commented Apr 10, 2018

Thanks @inf9144 - this looks good on first glance, but I've not been very involved with the android stuff, so might be best to wait for @kekekeks or someone else's input.

@@ -27,6 +27,8 @@ public AvaloniaView(Context context) : base(context)
AddView(_view.View);
_root = new EmbeddableControlRoot(_view);
_root.Prepare();
if (AndroidPlatform.UseDeferredRendering)
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

@kekekeks
Copy link
Member

kekekeks commented Apr 11, 2018

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
https://developer.android.com/reference/android/view/SurfaceView.html
https://developer.android.com/reference/android/view/SurfaceHolder.html

@inf9144
Copy link
Author

inf9144 commented Apr 11, 2018

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 ;)

@kekekeks
Copy link
Member

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.

@grokys
Copy link
Member

grokys commented Jan 8, 2020

This has been inactive for nearly 2 years so going to close it. Please re-open if work on it continues.

@grokys grokys closed this Jan 8, 2020
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.

None yet

3 participants