egl: Rework error checking in eglGetCurrentSurface.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
This commit is contained in:
parent
8bb2485ed0
commit
6190663120
|
@ -568,8 +568,26 @@ eglGetCurrentContext(void)
|
||||||
EGLSurface EGLAPIENTRY
|
EGLSurface EGLAPIENTRY
|
||||||
eglGetCurrentSurface(EGLint readdraw)
|
eglGetCurrentSurface(EGLint readdraw)
|
||||||
{
|
{
|
||||||
_EGLSurface *s = _eglGetCurrentSurface(readdraw);
|
_EGLContext *ctx = _eglGetCurrentContext();
|
||||||
return _eglGetSurfaceHandle(s);
|
_EGLSurface *surf;
|
||||||
|
|
||||||
|
if (!ctx)
|
||||||
|
return EGL_NO_SURFACE;
|
||||||
|
|
||||||
|
switch (readdraw) {
|
||||||
|
case EGL_DRAW:
|
||||||
|
surf = ctx->DrawSurface;
|
||||||
|
break;
|
||||||
|
case EGL_READ:
|
||||||
|
surf = ctx->ReadSurface;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_eglError(EGL_BAD_PARAMETER, __FUNCTION__);
|
||||||
|
surf = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _eglGetSurfaceHandle(surf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue