Merge lp:~mterry/mir/fix-nested-crash into lp:mir
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1225 |
Proposed branch: | lp:~mterry/mir/fix-nested-crash |
Merge into: | lp:mir |
Diff against target: |
57 lines (+25/-3) 1 file modified
src/server/graphics/nested/nested_display.cpp (+25/-3) |
To merge this branch: | bzr merge lp:~mterry/mir/fix-nested-crash |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Approve | ||
Kevin DuBois (community) | Approve | ||
Review via email: mp+195320@code.launchpad.net |
Commit message
Fix a crash due to a failed eglMakeCurrent() call when in nested mode.
Description of the change
Fix a crash due to a failed eglMakeCurrent() call when in nested mode.
I'm not sure how to give reproduction steps that don't involve all of unity8. But if you happen to have set up unity8 in nested mode, you can see this by doing:
1) Open an app
2) Swipe from left (launcher) or right (switch app)
Either swipe will crash unity8, due to a "cannot bind buffer to texture without EGL context" error. kdub helped me trace it down. Apparently NestedGLContext should act a little more like AndroidGLContext and use a dummy pbuffer surface instead of EGL_NO_SURFACE. It's eglMakeCurrent() call was silently failing, and this caused crashes later.
So I've made NestedGLContext do some of the things AndroidGLContext does:
1) Release in destructor
2) Use a dummy pbuffer surface
3) Throw an exception if eglMakeCurrent fails.
I've tested and it fixes the crash for me.
Hm. This should be necessary only if the underlying EGL doesn't support EGL_KHR_ surfaceless_ context, and the Mesa stack (should!) supports that.