Mesa (master): egl: Make _eglGlobal initialize statically.
Brian Paul
brianp at kemper.freedesktop.org
Wed Aug 12 04:15:22 UTC 2009
Module: Mesa
Branch: master
Commit: 0e3687e33dd482115c1a0e39c50b424936cb05a6
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e3687e33dd482115c1a0e39c50b424936cb05a6
Author: Chia-I Wu <olvaffe at gmail.com>
Date: Mon Aug 10 16:37:28 2009 +0800
egl: Make _eglGlobal initialize statically.
Now that display and surface hash tables are moved out, _eglGlobal can
be initialized statically.
Signed-off-by: Chia-I Wu <olvaffe at gmail.com>
---
src/egl/main/eglapi.c | 1 -
src/egl/main/eglglobals.c | 32 ++++++--------------------------
src/egl/main/eglglobals.h | 10 ----------
3 files changed, 6 insertions(+), 37 deletions(-)
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index f0a6f7f..fde6b73 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -50,7 +50,6 @@ EGLDisplay EGLAPIENTRY
eglGetDisplay(NativeDisplayType nativeDisplay)
{
_EGLDisplay *dpy;
- _eglInitGlobals();
dpy = _eglFindDisplay(nativeDisplay);
if (!dpy) {
dpy = _eglNewDisplay(nativeDisplay);
diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c
index f2c1c21..8703168 100644
--- a/src/egl/main/eglglobals.c
+++ b/src/egl/main/eglglobals.c
@@ -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)
-{
-}
diff --git a/src/egl/main/eglglobals.h b/src/egl/main/eglglobals.h
index 47fd943..2f3c211 100644
--- a/src/egl/main/eglglobals.h
+++ b/src/egl/main/eglglobals.h
@@ -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 */
More information about the mesa-commit
mailing list