-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MapView: eglSwapBuffers Error #5721
Comments
@jfirebaugh I'm reading up on the core classes and came accross
cc @tmpsantos |
@ivovandongen Are you referring to the |
@jfirebaugh Yes. Thanks for the clarification. |
Dove a little bit further in this. The issues seem to be caused by a combination of factors. In short; the Assuming the callback in core is meant to happen synchronously there are two approaches we can take here:
I prefer the second approach as it nicely isolates the callbacks, has a minimal impact and also ensures callbacks are always on the main thread. A similar approach is already in place on other platforms, at least QT. |
Something like:
|
That's also similar to what we do with offline callbacks, e.g.:
|
Great diagnosis @ivovandongen -- I didn't think about nesting, but that's definitely the problem. The danger in reposting change events on the event loop is that someone might be relying on the current synchronous behavior, for example to update UI elements in sync with the map. We've definitely seen cases where, when similar events were not synchronous enough, they caused desynchronization between the map and other UI elements -- #1813, #5489. My preference would be to implement the "nested transaction" behavior for |
Thanks for confirming @jfirebaugh. We actually have 2 options then; Depending on wether multiple platforms need this, we can either a) implement it in core as the default behaviour or b) in the android Either way, I wouldn't mind taking a stab at it. |
/sub |
When chaining some operations on the MapView the map, applications crash due to an error while rendering. Specifically:
As @jfirebaugh suggests, it might be that the the MapView doesn't reactivate the GL Context properly. We need to check that the the context is deactivated and re-activated properly. Atm, it's easily re-produced by removing a layer within a camera animation finish callback.
It might be a good idea to isolate from issues like this by placing callbacks on the main looper. This ensures that the callbacks always happen on the main thread as well. A similar solution is also used on the QT bindings I believe (cc @tmpsantos).
cc @tobrun @zugaldia @bleege
The text was updated successfully, but these errors were encountered: