mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
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@gmail.com>
This commit is contained in:
parent
413969a920
commit
0e3687e33d
3 changed files with 6 additions and 37 deletions
|
|
@ -50,7 +50,6 @@ EGLDisplay EGLAPIENTRY
|
|||
eglGetDisplay(NativeDisplayType nativeDisplay)
|
||||
{
|
||||
_EGLDisplay *dpy;
|
||||
_eglInitGlobals();
|
||||
dpy = _eglFindDisplay(nativeDisplay);
|
||||
if (!dpy) {
|
||||
dpy = _eglNewDisplay(nativeDisplay);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue