-
Notifications
You must be signed in to change notification settings - Fork 131
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
Refactor scheduling events in render thread #1068
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yunikkk
reviewed
Jan 20, 2022
yunikkk
reviewed
Jan 20, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
yunikkk
reviewed
Jan 20, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
yunikkk
reviewed
Jan 20, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
yunikkk
reviewed
Jan 20, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
Chaoba
reviewed
Jan 20, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
yunikkk
approved these changes
Jan 20, 2022
yunikkk
reviewed
Jan 21, 2022
Chaoba
approved these changes
Jan 25, 2022
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.
LGTM
ank27
approved these changes
Jan 25, 2022
yunikkk
reviewed
Jan 25, 2022
yunikkk
reviewed
Jan 25, 2022
sdk/src/test/java/com/mapbox/maps/renderer/MapboxRendererTest.kt
Outdated
Show resolved
Hide resolved
yunikkk
reviewed
Jan 26, 2022
yunikkk
reviewed
Jan 26, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
yunikkk
reviewed
Jan 26, 2022
yunikkk
reviewed
Jan 26, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
yunikkk
reviewed
Jan 26, 2022
yunikkk
reviewed
Jan 26, 2022
yunikkk
reviewed
Jan 26, 2022
kiryldz
force-pushed
the
kdz-renderer-check-egl-queue-events
branch
from
February 1, 2022 12:03
180673a
to
2364753
Compare
kiryldz
force-pushed
the
kdz-renderer-check-egl-queue-events
branch
from
February 1, 2022 12:07
2364753
to
13d4fa3
Compare
yunikkk
reviewed
Feb 1, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
yunikkk
reviewed
Feb 1, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
yunikkk
reviewed
Feb 1, 2022
yunikkk
reviewed
Feb 2, 2022
yunikkk
reviewed
Feb 2, 2022
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
yunikkk
approved these changes
Feb 2, 2022
kiryldz
force-pushed
the
kdz-renderer-check-egl-queue-events
branch
from
February 2, 2022 16:40
51be911
to
727141e
Compare
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
MapView#queueEvent
will be executed properly on Mapbox render thread. Previously scheduling such events e.g. when render was not created properly could lead to a crash / be skipped if running OpenGL ES commands there.Additionally internal render scheduling logic was refactored / fixed:
MapView#queueEvent(runnable, needRender = true | false)
will be executed on render thread even if it's not fully prepared. In this case such events will keep to get re-scheduled with small delay (50 ms) until render thread is either ready or killed.MapView#queueEvent(runnable, needRender = true)
will be executed after map draw calls but before swapping buffersMapClient#scheduleTask
andMapView#queueEvent(runnable, needRender = false)
) now have a check to verify render thread is fully ready.User impact (optional)
Some data collected by
gfxinfo
by running benchmarks changing map camera.Average values for
easeTo
benchmark (5 runs, infinite moving camera between 3 points for 45 seconds).Average values for
flyTo
benchmark (5 runs, infinite moving camera between 3 points for 45 seconds).All the metrics look slightly better with refactor introduced in this PR although it's hard to gather very stable ones. Main idea is that code looks cleaner and less redundant actions are performed in rendering logic.
Pull request checklist:
@JvmOverloads
,@file:JvmName
, etc).mapbox-maps-android
changelog:<changelog>Fix dropping / crashing in user events scheduled on a render thread with MapView#queueEvent. Refactor scheduling logic for render thread in general slightly improving rendering performance.</changelog>
.v10.[version]
release branch fix / enhancement, merge it tomain
firstly and then port tov10.[version]
release branch.Fixes: #1044
PRs must be submitted under the terms of our Contributor License Agreement CLA.