Bug 571832 - Bind(Release)TexImage, fix complex logic commented by vlad

This commit is contained in:
Oleg Romashin 2010-06-24 06:04:28 -04:00
parent d24ded3dce
commit df74faa7fe

View File

@ -270,17 +270,15 @@ public:
PRBool BindTexImage() PRBool BindTexImage()
{ {
if (mBound) if (!mSurface)
if (!ReleaseTexImage()) return PR_FALSE;
return PR_FALSE;
if (mSurface) { if (mBound && !ReleaseTexImage())
EGLBoolean success; return PR_FALSE;
success = sEGLLibrary.fBindTexImage(mDisplay, (EGLSurface)mSurface,
LOCAL_EGL_BACK_BUFFER); EGLBoolean success = sEGLLibrary.fBindTexImage(mDisplay,
if (success == LOCAL_EGL_FALSE) (EGLSurface)mSurface, LOCAL_EGL_BACK_BUFFER);
return PR_FALSE; if (success == LOCAL_EGL_FALSE)
} else
return PR_FALSE; return PR_FALSE;
mBound = PR_TRUE; mBound = PR_TRUE;
@ -292,15 +290,12 @@ public:
if (!mBound) if (!mBound)
return PR_TRUE; return PR_TRUE;
if (!mDisplay) if (!mDisplay || !mSurface)
return PR_FALSE; return PR_FALSE;
if (mSurface) { EGLBoolean success;
EGLBoolean success; success = sEGLLibrary.fReleaseTexImage(mDisplay, (EGLSurface)mSurface, LOCAL_EGL_BACK_BUFFER);
success = sEGLLibrary.fReleaseTexImage(mDisplay, (EGLSurface)mSurface, LOCAL_EGL_BACK_BUFFER); if (success == LOCAL_EGL_FALSE)
if (success == LOCAL_EGL_FALSE)
return PR_FALSE;
} else
return PR_FALSE; return PR_FALSE;
mBound = PR_FALSE; mBound = PR_FALSE;