Android benchmark frame time (#1958)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
Alex Cristici
2024-02-01 22:30:56 +02:00
committed by GitHub
parent b683cceb3f
commit d2feec269e
22 changed files with 191 additions and 62 deletions

View File

@@ -60,7 +60,7 @@ class RemoveUnusedImagesTest : AppCenter() {
mapView.addOnCanRemoveUnusedStyleImageListener {
callbackLatch.countDown()
maplibreMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(0.0, 120.0), 8.0))
mapView.addOnDidFinishRenderingFrameListener {
mapView.addOnDidFinishRenderingFrameListener{ _, _, _ ->
assertNotNull(maplibreMap.style!!.getImage("small"))
assertNotNull(maplibreMap.style!!.getImage("large"))
latch.countDown()
@@ -89,7 +89,7 @@ class RemoveUnusedImagesTest : AppCenter() {
maplibreMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng(0.0, 120.0), 8.0))
// Wait for the next frame and check that images were removed from the style.
mapView.addOnDidFinishRenderingFrameListener {
mapView.addOnDidFinishRenderingFrameListener { _, _, _ ->
if (maplibreMap.style!!.getImage("small") == null && maplibreMap.style!!.getImage("large") == null) {
latch.countDown()
}