-
Notifications
You must be signed in to change notification settings - Fork 153
Custom widget render #1036
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
Custom widget render #1036
Conversation
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.
Some comments
android-auto-app/src/main/java/com/mapbox/maps/testapp/auto/car/CarCameraController.kt
Outdated
Show resolved
Hide resolved
android-auto-app/src/main/java/com/mapbox/maps/testapp/auto/car/MapSession.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/mapbox/maps/testapp/examples/customlayer/ExampleCustomLayer.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/MapboxWidgetRenderer.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/MapboxWidgetRenderer.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
extension-androidauto/src/main/java/com/mapbox/maps/extension/androidauto/BaseWidgetRenderer.kt
Outdated
Show resolved
Hide resolved
extension-androidauto/src/main/java/com/mapbox/maps/extension/androidauto/BaseWidgetRenderer.kt
Outdated
Show resolved
Hide resolved
68b792e to
1896355
Compare
sdk/src/main/java/com/mapbox/maps/renderer/widget/BitmapWidget.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/gl/TextureRenderer.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/widget/BitmapWidgetRenderer.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/widget/BitmapWidgetRenderer.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/widget/BitmapWidgetRenderer.kt
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/widget/BitmapWidgetRenderer.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/widget/BitmapWidgetRenderer.kt
Outdated
Show resolved
Hide resolved
sdk/src/main/java/com/mapbox/maps/renderer/widget/WidgetPosition.kt
Outdated
Show resolved
Hide resolved
1896355 to
4f2f15a
Compare
android-auto-app/src/main/java/com/mapbox/maps/testapp/auto/car/MapSession.kt
Show resolved
Hide resolved
android-auto-app/src/main/java/com/mapbox/maps/testapp/auto/car/MapSession.kt
Show resolved
Hide resolved
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
sdk/src/main/java/com/mapbox/maps/renderer/MapboxRenderThread.kt
Outdated
Show resolved
Hide resolved
| verifyBlock = verifyBlock, | ||
| ) | ||
|
|
||
| internal fun waitZeroCounter(startCounter: Int = 1, timeoutMillis: Int = 1000, runnable: CountDownLatch.() -> Unit) { |
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.
Util to ease tests working with CountdownLatches / waiting for the zero and throwing exception afterwards
| throw TimeoutException() | ||
| initRenderThread() | ||
| provideValidSurface() | ||
| waitZeroCounter { |
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.
Here and below we need latches since Handler is stopped in destroy().
Other tests are rewritten so that unneeded latches are not created - instead we pause and idle handler thread accordingly to handle posted runnables
extension-androidauto/src/main/java/com/mapbox/maps/extension/androidauto/CompassWidget.kt
Show resolved
Hide resolved
extension-androidauto/src/main/java/com/mapbox/maps/extension/androidauto/LogoWidget.kt
Outdated
Show resolved
Hide resolved
37a884d to
f3529b4
Compare
…xture on top of the map.
e8f4035 to
e61631d
Compare
e61631d to
a77a944
Compare
PR is based on POC.
I've added separate GL context that renders all widgets to the texture (if any of widgets are dirty) in the offscreen surface.
New GL context is also shared with the old one thus MapboxRenderThread is able to render the texture with widgets on top of the map.
Seems to be working with approximately the same speed as single context version.
If no widgets are added - separate GL context and rest of the EGL won't be created at all, thus no impact to the performance at all.
Rest of the widgets will be added separately since they are in fact built on top of this PR.
Screenshot of the auto emulator with compass / logo displayed :