egl: Make display and surface hash tables local.

Move display and surface hash tables to egldisplay.c, and have them
initialized on demand.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
This commit is contained in:
Chia-I Wu
2009-08-10 14:16:32 +08:00
committed by Brian Paul
parent 56d2119280
commit 621801abd2
4 changed files with 78 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
#include <stdlib.h>
#include "eglglobals.h"
#include "egldisplay.h"
#include "egllog.h"
struct _egl_global _eglGlobal =
@@ -15,8 +16,6 @@ void
_eglInitGlobals(void)
{
if (!_eglGlobal.Initialized) {
_eglGlobal.Displays = _eglNewHashTable();
_eglGlobal.Surfaces = _eglNewHashTable();
_eglGlobal.FreeScreenHandle = 1;
_eglGlobal.Initialized = EGL_TRUE;
@@ -31,7 +30,4 @@ _eglInitGlobals(void)
void
_eglDestroyGlobals(void)
{
/* XXX TODO walk over table entries, deleting each */
_eglDeleteHashTable(_eglGlobal.Displays);
_eglDeleteHashTable(_eglGlobal.Surfaces);
}