Replies: 1 comment 1 reply
-
What are you trying to do? Frame metrics can't come from a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is not directly related to Filament but something I have to use because am using Filament. Cross posting here (originally posted in reddit). Hoping to get some help here 🙏
I need to use the new FrameMetric API introduced in Android N on the SurfaceView. Since that API is available only on the window property I can't use it on the SurfaceView (which has its own Window but not exposed unlike Activity#window)
I tried
activity.window.addOnFrameMetricsAvailableListener
on the activity to which the SurfaceView is added but theonFrameMetricsAvailable
is never called. It gets called on activities without the SurfaceView (occupying whole layout)So I believe I should call
addOnFrameMetricsAvailableListener
on the SurfaceView's window to get the callbackWhy not use
Choreographer#FrameCallback#doFrame
to manually calculate the frames per second (just by having a counter, incrementing in doFrame & resetting every second)?This fantastic video https://youtu.be/R6kqZQusv1U?t=517 explains why FPS is not that good of a metric & we should rather depend on FrameMetric for a reliable frame rate performance
Filament also accepts TextureView which shares the activity's window, so I think the callback should work just fine with TextView but it looks like SurfaceView is the recommended choice for 3D rendering. So we're sticking with SurfaceView
Beta Was this translation helpful? Give feedback.
All reactions