servo/surfman

surfman with winit crashes on Android Emulator

iamralpht opened this issue · 0 comments

Using surfman with the winit ndk glue results in a crash when creating the window surface on recent Android Emulators, and on cuttlefish (Android's "board" for running the OS in a hypervisor, using virgl).

Surfman's Android platform create_window_surface makes the context current without a draw or read buffer (in order to find out the EGLConfig to specify when making the window surface), which is only supported on "surfaceless contexts" which the Android virtualized EGL doesn't seem to handle. Making the context current fails, and surfman then crashes a little later on attempting to use a null string returned by glGetString.

We can actually just use the get_context_attr and egl_config_from_id functions to get the EGLConfig and avoid making the context current without surfaces.