OSDN Git Service

Remove display initialization from eglGetProcAddress API
authorTina Zhang <tina.zhang@intel.com>
Wed, 23 Jul 2014 08:34:48 +0000 (16:34 +0800)
committerbohu <bohu@google.com>
Fri, 19 Sep 2014 00:15:44 +0000 (17:15 -0700)
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

system/egl/egl.cpp

index 72e0037..daa52de 100644 (file)
@@ -526,15 +526,6 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
         }
     }
 
-    //
-    // 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);