Skip to content

Conversation

@yunikkk
Copy link
Contributor

@yunikkk yunikkk commented Jan 11, 2022

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 :

image

@yunikkk yunikkk requested review from kiryldz and pengdev January 11, 2022 13:31
Copy link
Contributor

@kiryldz kiryldz left a comment

Choose a reason for hiding this comment

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

Some comments

@yunikkk yunikkk force-pushed the yds-custom-widget-render branch 3 times, most recently from 68b792e to 1896355 Compare January 24, 2022 17:32
@yunikkk yunikkk changed the title Custom widget render draft Custom widget render Jan 24, 2022
@yunikkk yunikkk requested a review from a team January 24, 2022 17:44
@yunikkk yunikkk marked this pull request as ready for review January 24, 2022 18:08
@yunikkk yunikkk force-pushed the yds-custom-widget-render branch from 1896355 to 4f2f15a Compare January 25, 2022 12:41
verifyBlock = verifyBlock,
)

internal fun waitZeroCounter(startCounter: Int = 1, timeoutMillis: Int = 1000, runnable: CountDownLatch.() -> Unit) {
Copy link
Contributor Author

@yunikkk yunikkk Feb 10, 2022

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 {
Copy link
Contributor Author

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

@yunikkk yunikkk force-pushed the yds-custom-widget-render branch from 37a884d to f3529b4 Compare February 10, 2022 16:08
@yunikkk yunikkk force-pushed the yds-custom-widget-render branch from e8f4035 to e61631d Compare February 11, 2022 15:12
@yunikkk yunikkk force-pushed the yds-custom-widget-render branch from e61631d to a77a944 Compare February 11, 2022 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants