aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/host/libs/Translator/EGL
diff options
context:
space:
mode:
Diffstat (limited to 'emulator/opengl/host/libs/Translator/EGL')
-rw-r--r--emulator/opengl/host/libs/Translator/EGL/EglDisplay.cpp12
-rw-r--r--emulator/opengl/host/libs/Translator/EGL/EglImp.cpp8
-rw-r--r--emulator/opengl/host/libs/Translator/EGL/EglX11Api.cpp6
3 files changed, 13 insertions, 13 deletions
diff --git a/emulator/opengl/host/libs/Translator/EGL/EglDisplay.cpp b/emulator/opengl/host/libs/Translator/EGL/EglDisplay.cpp
index 99f9d8b..3516986 100644
--- a/emulator/opengl/host/libs/Translator/EGL/EglDisplay.cpp
+++ b/emulator/opengl/host/libs/Translator/EGL/EglDisplay.cpp
@@ -142,7 +142,7 @@ EglConfig* EglDisplay::getConfig(EGLConfig conf) {
SurfacePtr EglDisplay::getSurface(EGLSurface surface) {
android::Mutex::Autolock mutex(m_lock);
/* surface is "key" in map<unsigned int, SurfacePtr>. */
- unsigned int hndl = ToTargetCompatibleHandle((uintptr_t)surface);
+ unsigned int hndl = SafeUIntFromPointer(surface);
SurfacesHndlMap::iterator it = m_surfaces.find(hndl);
return it != m_surfaces.end() ?
(*it).second :
@@ -152,7 +152,7 @@ SurfacePtr EglDisplay::getSurface(EGLSurface surface) {
ContextPtr EglDisplay::getContext(EGLContext ctx) {
android::Mutex::Autolock mutex(m_lock);
/* ctx is "key" in map<unsigned int, ContextPtr>. */
- unsigned int hndl = ToTargetCompatibleHandle((uintptr_t)ctx);
+ unsigned int hndl = SafeUIntFromPointer(ctx);
ContextsHndlMap::iterator it = m_contexts.find(hndl);
return it != m_contexts.end() ?
(*it).second :
@@ -162,7 +162,7 @@ ContextPtr EglDisplay::getContext(EGLContext ctx) {
bool EglDisplay::removeSurface(EGLSurface s) {
android::Mutex::Autolock mutex(m_lock);
/* s is "key" in map<unsigned int, SurfacePtr>. */
- unsigned int hndl = ToTargetCompatibleHandle((uintptr_t)s);
+ unsigned int hndl = SafeUIntFromPointer(s);
SurfacesHndlMap::iterator it = m_surfaces.find(hndl);
if(it != m_surfaces.end()) {
m_surfaces.erase(it);
@@ -191,7 +191,7 @@ bool EglDisplay::removeSurface(SurfacePtr s) {
bool EglDisplay::removeContext(EGLContext ctx) {
android::Mutex::Autolock mutex(m_lock);
/* ctx is "key" in map<unsigned int, ContextPtr>. */
- unsigned int hndl = ToTargetCompatibleHandle((uintptr_t)ctx);
+ unsigned int hndl = SafeUIntFromPointer(ctx);
ContextsHndlMap::iterator it = m_contexts.find(hndl);
if(it != m_contexts.end()) {
m_contexts.erase(it);
@@ -295,7 +295,7 @@ EGLImageKHR EglDisplay::addImageKHR(ImagePtr img) {
ImagePtr EglDisplay::getImage(EGLImageKHR img) {
android::Mutex::Autolock mutex(m_lock);
/* img is "key" in map<unsigned int, ImagePtr>. */
- unsigned int hndl = ToTargetCompatibleHandle((uintptr_t)img);
+ unsigned int hndl = SafeUIntFromPointer(img);
ImagesHndlMap::iterator i( m_eglImages.find(hndl) );
return (i != m_eglImages.end()) ? (*i).second :ImagePtr(NULL);
}
@@ -303,7 +303,7 @@ ImagePtr EglDisplay::getImage(EGLImageKHR img) {
bool EglDisplay:: destroyImageKHR(EGLImageKHR img) {
android::Mutex::Autolock mutex(m_lock);
/* img is "key" in map<unsigned int, ImagePtr>. */
- unsigned int hndl = ToTargetCompatibleHandle((uintptr_t)img);
+ unsigned int hndl = SafeUIntFromPointer(img);
ImagesHndlMap::iterator i( m_eglImages.find(hndl) );
if (i != m_eglImages.end())
{
diff --git a/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp b/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp
index d03c9db..1d5c494 100644
--- a/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp
+++ b/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp
@@ -815,7 +815,7 @@ EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void) {
if(dpy && ctx.Ptr()){
// This double check is required because a context might still be current after it is destroyed - in which case
// its handle should be invalid, that is EGL_NO_CONTEXT should be returned even though the context is current
- EGLContext c = (EGLContext)ctx->getHndl();
+ EGLContext c = (EGLContext)SafePointerFromUInt(ctx->getHndl());
if(dpy->getContext(c).Ptr())
{
return c;
@@ -839,7 +839,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw) {
// current after it is destroyed - in which case its handle should
// be invalid, that is EGL_NO_SURFACE should be returned even
// though the surface is current.
- EGLSurface s = (EGLSurface)surface->getHndl();
+ EGLSurface s = (EGLSurface)SafePointerFromUInt(surface->getHndl());
surface = dpy->getSurface(s);
if(surface.Ptr())
{
@@ -1033,13 +1033,13 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay display, EGLContext context, EGLenum ta
ThreadInfo* thread = getThreadInfo();
ShareGroupPtr sg = thread->shareGroup;
if (sg.Ptr() != NULL) {
- unsigned int globalTexName = sg->getGlobalName(TEXTURE, (uintptr_t)buffer);
+ unsigned int globalTexName = sg->getGlobalName(TEXTURE, SafeUIntFromPointer(buffer));
if (!globalTexName) return EGL_NO_IMAGE_KHR;
ImagePtr img( new EglImage() );
if (img.Ptr() != NULL) {
- ObjectDataPtr objData = sg->getObjectData(TEXTURE, (uintptr_t)buffer);
+ ObjectDataPtr objData = sg->getObjectData(TEXTURE, SafeUIntFromPointer(buffer));
if (!objData.Ptr()) return EGL_NO_IMAGE_KHR;
TextureData *texData = (TextureData *)objData.Ptr();
diff --git a/emulator/opengl/host/libs/Translator/EGL/EglX11Api.cpp b/emulator/opengl/host/libs/Translator/EGL/EglX11Api.cpp
index 129f244..a8c624e 100644
--- a/emulator/opengl/host/libs/Translator/EGL/EglX11Api.cpp
+++ b/emulator/opengl/host/libs/Translator/EGL/EglX11Api.cpp
@@ -71,7 +71,7 @@ int ErrorHandler::errorHandlerProc(EGLNativeDisplayType dpy,XErrorEvent* event){
}
#define IS_SUCCESS(a) \
- if(a != Success) return false;
+ if(a != Success) return 0;
namespace EglOS {
@@ -193,7 +193,7 @@ bool validNativePixmap(EGLNativeDisplayType dpy,EGLNativeSurfaceType pix) {
int tmp;
unsigned int utmp;
ErrorHandler handler(dpy);
- if(!XGetGeometry(dpy,pix ? pix->srfc() : NULL,&root,&tmp,&tmp,&utmp,&utmp,&utmp,&utmp)) return false;
+ if(!XGetGeometry(dpy,pix ? pix->srfc() : 0,&root,&tmp,&tmp,&utmp,&utmp,&utmp,&utmp)) return false;
return handler.getLastError() == 0;
}
@@ -260,7 +260,7 @@ bool makeCurrent(EGLNativeDisplayType dpy,EglSurface* read,EglSurface* draw,EGLN
bool retval = false;
if (!ctx && !read && !draw) {
// unbind
- retval = glXMakeContextCurrent(dpy, NULL, NULL, NULL);
+ retval = glXMakeContextCurrent(dpy, 0, 0, NULL);
}
else if (ctx && read && draw) {
retval = glXMakeContextCurrent(dpy,draw->native()->srfc(),read->native()->srfc(),ctx);