We don't need to do the initialization in the eglGetProcAddress API. The work
can be finished in the eglInitialize API. When zygote pre-loading resources,
eglGetProcAddress will be called. If we let eglGetProcAddress do the display
initialization, zygote will get the "qemu-pipe" handle of the "opengles"
service. This is bad, because all the java processes which forked from zygote
will get the same handle from zygote. Then the host service cannot distinguish
from the device threads, and this will lead the emulator to crash.
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
Signed-off-by: WeixingX Tian <weixingx.tian@intel.com>
(cherry picked from commit
7a2929cd6548693b581c17ba69308a49e03c56be)
Change-Id: I156970e004172e0bbe23a1a0c6c6b86850fd2ba6
}
}
- //
- // Make sure display is initialized before searching in client APIs
- //
- if (!s_display.initialized()) {
- if (!s_display.initialize(&s_eglIface)) {
- return NULL;
- }
- }
-
// look in gles client api's extensions table
return (__eglMustCastToProperFunctionPointerType)ClientAPIExts::getProcAddress(procname);