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

Expose RENDERMODE_CONTINUOUSLY and RENDERMODE_WHEN_DIRTY #2801

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

alasram
Copy link
Collaborator

@alasram alasram commented Sep 4, 2024

To save power, MapLibre only renders the map scene when it becomes dirty (an Android event causes the map to change). This behavior is desired in production. However, when testing performance and particularly trying to automatically detect stuttering, it is better to use continuous rendering.
GLSurfaceView already has the ability to switch between RENDERMODE_CONTINUOUSLY and RENDERMODE_WHEN_DIRTY. This PR simply exposes these options to MapLibre client apps.

@alasram alasram added the android label Sep 4, 2024
@alasram alasram requested review from louwers and mwilsnd September 4, 2024 22:43
@alasram
Copy link
Collaborator Author

alasram commented Sep 5, 2024

@louwers CI is failing. Can you tell me what log I should look at to understand the failure?

@louwers
Copy link
Collaborator

louwers commented Sep 5, 2024

Hmm the logs should show up if you click through but

Test spec output for run 'arn:aws:devicefarm:us-west-2:373521797162:run:20687d72-0e46-403e-8f03-0941850665bc/5146eb99-3855-474d-aa1c-8f132baf221e' not found

AWS Device Farm logs can also be found via this guide: https://github.com/maplibre/maplibre-native/wiki/AWS-Device-Farm-Logs

Did you try running the (Android) C++ Unit Tests locally? They are in test/android.

@alasram
Copy link
Collaborator Author

alasram commented Sep 5, 2024

@louwers All tests are passing on my phone. The runner hangs at the end but this is true on main as well. It shows this log without returning (I have to manually kill the process):

2024-09-05 14:36:42.267 11218-11255 GTest                   org.maplibre.cpp_test_runner         I  Test program ended with 955 tests run.
2024-09-05 14:36:42.267 11218-11255 mbgl                    org.maplibre.cpp_test_runner         I  {Thread-139}[General]: TestRunner finished with status: '0'
2024-09-05 14:36:42.268 11218-11247 mbgl                    org.maplibre.cpp_test_runner         I  {Thread-2}[General]: TestRunner done

@alasram alasram force-pushed the alasram/continuous_fps_option branch 2 times, most recently from 583ace9 to 8b9a439 Compare September 11, 2024 20:24
Copy link
Collaborator

@louwers louwers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do users know when the view is ready for this method to be called?

I don't really like this API. If I understand it correctly, it is OpenGL specific. Taking an int (instead of some kind of enum class) is acceptable for internal API but not so much for a public API. And if we want people to configure low level rendering, we should expose that on some low level object, otherwise the MapView will turn into a kitchen sink.

What do you think? Is there another way we can expose this?

@alasram alasram force-pushed the alasram/continuous_fps_option branch from 8b9a439 to 42c92b2 Compare September 13, 2024 22:56
@alasram
Copy link
Collaborator Author

alasram commented Sep 13, 2024

@louwers You're right that exposing it as-is to client apps without a proper enum is wrong. I fixed this. It should work in both Vulkan and GL. It won't work for TextureView which seems to be a deprecated feature.

@alasram alasram force-pushed the alasram/continuous_fps_option branch from 42c92b2 to 724717e Compare September 14, 2024 00:34
Copy link
Collaborator

@louwers louwers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the enum.

I have one more request, we should add some test coverage. At the minimum just toggling the rendering refresh mode similar to: https://github.com/alexcristici/maplibre-native/blob/f74f4ff3cf3983a07cbd25391103d8f2950846d5/platform/android/MapLibreAndroidTestApp/src/androidTest/java/org/maplibre/android/maps/MapLibreMapTest.kt#L471-L481

@alasram alasram force-pushed the alasram/continuous_fps_option branch from 724717e to b379f63 Compare September 16, 2024 23:07
@alasram alasram force-pushed the alasram/continuous_fps_option branch from b379f63 to 5bba75f Compare September 17, 2024 17:48
@alasram alasram merged commit 77a464d into maplibre:main Sep 17, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants