-
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
Fix bitmap widgets not rendering or crashing on specific devices #1834
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
alexander-kulikovskii
approved these changes
Nov 15, 2022
jush
approved these changes
Nov 15, 2022
kiryldz
changed the title
Fix bitmap widgets not rendering on specific devices
Fix bitmap widgets not rendering or crashing on specific devices
Nov 15, 2022
paulrenn67
approved these changes
Nov 15, 2022
jush
approved these changes
Nov 15, 2022
pengdev
reviewed
Nov 15, 2022
kiryldz
force-pushed
the
kdz-fix-xiaomi-widget-render
branch
2 times, most recently
from
November 15, 2022 15:18
5f8eb19
to
ad2f86a
Compare
jush
reviewed
Nov 15, 2022
jush
reviewed
Nov 15, 2022
kiryldz
force-pushed
the
kdz-fix-xiaomi-widget-render
branch
from
November 15, 2022 15:20
ad2f86a
to
d0fcfcc
Compare
kiryldz
requested review from
jush,
pengdev,
alexander-kulikovskii and
paulrenn67
November 15, 2022 15:21
kiryldz
force-pushed
the
kdz-fix-xiaomi-widget-render
branch
from
November 15, 2022 15:29
d0fcfcc
to
14e3887
Compare
every { lifecycle } returns lifecycleOwner.lifecycle | ||
} | ||
|
||
mockkStatic("com.mapbox.maps.MapboxLogger") |
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.
Suggested change
mockkStatic("com.mapbox.maps.MapboxLogger") | |
mockkStatic(MapboxLoggerClassName) |
verify(exactly = 1) { | ||
mapboxCarMap.setup(sessionCarContext, capture(mapInitOptions)) | ||
} | ||
assert(mapInitOptions.captured.mapOptions.contextMode == ContextMode.SHARED) |
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.
Suggested change
assert(mapInitOptions.captured.mapOptions.contextMode == ContextMode.SHARED) | |
assertEquals(mapInitOptions.captured.mapOptions.contextMode, ContextMode.SHARED) |
yunikkk
approved these changes
Nov 15, 2022
kiryldz
force-pushed
the
kdz-fix-xiaomi-widget-render
branch
from
November 15, 2022 16:21
14e3887
to
0a7f911
Compare
kmadsen
reviewed
Nov 15, 2022
...roidauto/src/main/java/com/mapbox/maps/extension/androidauto/MapboxCarMapSessionInstaller.kt
Show resolved
Hide resolved
kmadsen
reviewed
Nov 15, 2022
...roidauto/src/main/java/com/mapbox/maps/extension/androidauto/MapboxCarMapSessionInstaller.kt
Outdated
Show resolved
Hide resolved
kmadsen
approved these changes
Nov 15, 2022
This was referenced Nov 15, 2022
jush
approved these changes
Nov 16, 2022
kiryldz
force-pushed
the
kdz-fix-xiaomi-widget-render
branch
from
November 16, 2022 09:11
2ec199d
to
894a03f
Compare
pengdev
reviewed
Nov 16, 2022
pengdev
approved these changes
Nov 16, 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 with a nit
kiryldz
force-pushed
the
kdz-fix-xiaomi-widget-render
branch
from
November 16, 2022 09:50
894a03f
to
3ab2bd1
Compare
kiryldz
added a commit
that referenced
this pull request
Nov 16, 2022
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
Some devices (using Adreno GPUs) could not render bitmap widgets as depth test is enabled and thus widgets are rendered under the map.
The inital fix was to explicitly disable depth test on render thread OpenGL context before drawing the widget - however that just partly fixes the issue.
However correct fix also fixing atmosphere crash on Adreno GPUs is to use shared context when creating MapSurface / MapView with widgets. Both
MapSurface
/MapView
will throw runtime exception now if widgets are trying to be added andMapOptions.contextMode != SHARED
.At the same time for the Mapbox Android Auto extension
MapOptions.contextMode = SHARED
is enforced in any case as Android Auto introduces compass / bitmap widgets which are most likely used by the user and preventing runtime crashing.User impact (optional)
Pull request checklist:
@JvmOverloads
,@file:JvmName
, etc).make update-api
to update generated api files, if there's public API changes, otherwise theverify-api-*
CI steps might fail.check changelog
CI step will fail.v10.[version]
release branch fix / enhancement, merge it tomain
firstly and then port tov10.[version]
release branch.Fixes: < Link to related issues that will be fixed by this pull request, if they exist >
PRs must be submitted under the terms of our Contributor License Agreement CLA.