Commit 53e38860 by Nicolas Capens

Avoid resetting the EGL error code on client context retrieval.

BUG=18208531 Change-Id: I0246a6fcfdeefd8c84a28c3d86723d50d3f0cbac
parent e2540106
...@@ -33,4 +33,8 @@ EXPORTS ...@@ -33,4 +33,8 @@ EXPORTS
eglTerminate @4 eglTerminate @4
eglWaitClient @16 eglWaitClient @16
eglWaitGL @30 eglWaitGL @30
eglWaitNative @31 eglWaitNative @31
\ No newline at end of file
; Functions that don't change the error code, for use by client APIs
clientGetCurrentContext
clientGetCurrentDisplay
\ No newline at end of file
...@@ -255,7 +255,7 @@ void setCurrentContext(EGLContext ctx) ...@@ -255,7 +255,7 @@ void setCurrentContext(EGLContext ctx)
current->context = ctx; current->context = ctx;
} }
EGLDisplay getCurrentContext() EGLContext getCurrentContext()
{ {
Current *current = eglGetCurrent(); Current *current = eglGetCurrent();
...@@ -318,6 +318,19 @@ void error(EGLint errorCode) ...@@ -318,6 +318,19 @@ void error(EGLint errorCode)
} }
} }
extern "C"
{
EGLContext clientGetCurrentContext()
{
return egl::getCurrentContext();
}
EGLContext clientGetCurrentDisplay()
{
return egl::getCurrentDisplay();
}
}
namespace es1 namespace es1
{ {
egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext) = 0; egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext) = 0;
......
...@@ -50,8 +50,8 @@ CONSTRUCTOR static bool glAttachProcess() ...@@ -50,8 +50,8 @@ CONSTRUCTOR static bool glAttachProcess()
#endif #endif
libEGL = loadLibrary(libEGL_lib); libEGL = loadLibrary(libEGL_lib);
egl::getCurrentContext = (egl::Context *(*)())getProcAddress(libEGL, "eglGetCurrentContext"); egl::getCurrentContext = (egl::Context *(*)())getProcAddress(libEGL, "clientGetCurrentContext");
egl::getCurrentDisplay = (egl::Display *(*)())getProcAddress(libEGL, "eglGetCurrentDisplay"); egl::getCurrentDisplay = (egl::Display *(*)())getProcAddress(libEGL, "clientGetCurrentDisplay");
return libEGL != 0; return libEGL != 0;
} }
......
...@@ -50,8 +50,8 @@ CONSTRUCTOR static bool glAttachProcess() ...@@ -50,8 +50,8 @@ CONSTRUCTOR static bool glAttachProcess()
#endif #endif
libEGL = loadLibrary(libEGL_lib); libEGL = loadLibrary(libEGL_lib);
egl::getCurrentContext = (egl::Context *(*)())getProcAddress(libEGL, "eglGetCurrentContext"); egl::getCurrentContext = (egl::Context *(*)())getProcAddress(libEGL, "clientGetCurrentContext");
egl::getCurrentDisplay = (egl::Display *(*)())getProcAddress(libEGL, "eglGetCurrentDisplay"); egl::getCurrentDisplay = (egl::Display *(*)())getProcAddress(libEGL, "clientGetCurrentDisplay");
#if defined(_WIN32) #if defined(_WIN32)
const char *libGLES_CM_lib[] = {"libGLES_CM.dll", "libGLES_CM_translator.dll"}; const char *libGLES_CM_lib[] = {"libGLES_CM.dll", "libGLES_CM_translator.dll"};
......
...@@ -33,4 +33,8 @@ EXPORTS ...@@ -33,4 +33,8 @@ EXPORTS
eglTerminate @4 eglTerminate @4
eglWaitClient @16 eglWaitClient @16
eglWaitGL @30 eglWaitGL @30
eglWaitNative @31 eglWaitNative @31
\ No newline at end of file
; Functions that don't change the error code, for use by client APIs
clientGetCurrentContext
clientGetCurrentDisplay
\ No newline at end of file
...@@ -237,7 +237,7 @@ void setCurrentContext(EGLContext ctx) ...@@ -237,7 +237,7 @@ void setCurrentContext(EGLContext ctx)
current->context = ctx; current->context = ctx;
} }
EGLDisplay getCurrentContext() EGLContext getCurrentContext()
{ {
Current *current = eglGetCurrent(); Current *current = eglGetCurrent();
...@@ -300,6 +300,19 @@ void error(EGLint errorCode) ...@@ -300,6 +300,19 @@ void error(EGLint errorCode)
} }
} }
extern "C"
{
EGLContext clientGetCurrentContext()
{
return egl::getCurrentContext();
}
EGLContext clientGetCurrentDisplay()
{
return egl::getCurrentDisplay();
}
}
namespace rad namespace rad
{ {
egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext) = 0; egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext) = 0;
......
...@@ -50,8 +50,8 @@ CONSTRUCTOR static bool glAttachProcess() ...@@ -50,8 +50,8 @@ CONSTRUCTOR static bool glAttachProcess()
#endif #endif
libEGL = loadLibrary(libEGL_lib); libEGL = loadLibrary(libEGL_lib);
egl::getCurrentContext = (egl::Context *(*)())getProcAddress(libEGL, "eglGetCurrentContext"); egl::getCurrentContext = (egl::Context *(*)())getProcAddress(libEGL, "clientGetCurrentContext");
egl::getCurrentDisplay = (egl::Display *(*)())getProcAddress(libEGL, "eglGetCurrentDisplay"); egl::getCurrentDisplay = (egl::Display *(*)())getProcAddress(libEGL, "clientGetCurrentDisplay");
return libEGL != 0; return libEGL != 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment