egl: Make _eglGlobal initialize statically.
authorChia-I Wu <olvaffe@gmail.com>
Mon, 10 Aug 2009 08:37:28 +0000 (16:37 +0800)
committerBrian Paul <brianp@vmware.com>
Wed, 12 Aug 2009 04:14:35 +0000 (22:14 -0600)
Now that display and surface hash tables are moved out, _eglGlobal can
be initialized statically.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/egl/main/eglapi.c
src/egl/main/eglglobals.c
src/egl/main/eglglobals.h

index f0a6f7f935569c43e8334adbf719ca0f90d1b3ec..fde6b7316c8f31a50fac9eae29e5da0a284dcb7d 100644 (file)
@@ -50,7 +50,6 @@ EGLDisplay EGLAPIENTRY
 eglGetDisplay(NativeDisplayType nativeDisplay)
 {
    _EGLDisplay *dpy;
-   _eglInitGlobals();
    dpy = _eglFindDisplay(nativeDisplay);
    if (!dpy) {
       dpy = _eglNewDisplay(nativeDisplay);
index f2c1c217a5d01e93dde61190484c4b7b04f3e2a6..870316865007ecd6e16ea0dd3a74bf52d405758a 100644 (file)
@@ -3,31 +3,11 @@
 #include "egldisplay.h"
 #include "egllog.h"
 
-struct _egl_global _eglGlobal = 
+struct _egl_global _eglGlobal =
 {
-   EGL_FALSE
+   1,                      /* FreeScreenHandle */
+   0x0,                    /* ClientAPIsMask */
+   { 0x0 },                /* ClientAPIs */
+   0,                      /* NumDrivers */
+   { NULL },               /* Drivers */
 };
-
-/**
- * Init the fields in the _eglGlobal struct
- * May be safely called more than once.
- */
-void
-_eglInitGlobals(void)
-{
-   if (!_eglGlobal.Initialized) {
-      _eglGlobal.FreeScreenHandle = 1;
-      _eglGlobal.Initialized = EGL_TRUE;
-
-      _eglGlobal.ClientAPIsMask = 0x0;
-   }
-}
-
-
-/**
- * Should call this via an atexit handler.
- */
-void
-_eglDestroyGlobals(void)
-{
-}
index 47fd943fd53c9ef677a2627e4805c9666f2d18fa..2f3c211476f81401f4112977311ac8bfbdcd95a8 100644 (file)
@@ -11,8 +11,6 @@
  */
 struct _egl_global
 {
-   EGLBoolean Initialized;
-
    EGLScreenMESA FreeScreenHandle;
 
    /* bitmaks of supported APIs (supported by _some_ driver) */
@@ -28,12 +26,4 @@ struct _egl_global
 extern struct _egl_global _eglGlobal;
 
 
-extern void
-_eglInitGlobals(void);
-
-
-extern void
-_eglDestroyGlobals(void);
-
-
 #endif /* EGLGLOBALS_INCLUDED */