summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-07-16 21:21:56 -0700
committerBrian Paul <[email protected]>2009-07-17 11:53:39 -0600
commitbe9d1ab171b1b29108c781af84dd500707a12925 (patch)
treebdaf340d06688f7158f73eb50ead0a5013eaee86 /src/egl/main/eglapi.c
parentcca31340b5a9c0b941946753a31236c7201ca87c (diff)
egl: Return the same EGL Display for the same native display.
The latest revision of the spec explicitly requires the same handle to be returned for the same native display. Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/egl/main/eglapi.c')
-rw-r--r--src/egl/main/eglapi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index eaee9facd82..f0a6f7f9355 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -51,9 +51,12 @@ eglGetDisplay(NativeDisplayType nativeDisplay)
{
_EGLDisplay *dpy;
_eglInitGlobals();
- dpy = _eglNewDisplay(nativeDisplay);
- if (dpy)
- _eglLinkDisplay(dpy);
+ dpy = _eglFindDisplay(nativeDisplay);
+ if (!dpy) {
+ dpy = _eglNewDisplay(nativeDisplay);
+ if (dpy)
+ _eglLinkDisplay(dpy);
+ }
return _eglGetDisplayHandle(dpy);
}