b=567272; wglMakeCurrent is expensive; r=bas

This commit is contained in:
Vladimir Vukicevic 2010-05-20 17:20:39 -07:00
parent 14ac9d5f07
commit 525840a488

View File

@ -207,8 +207,17 @@ public:
PRBool MakeCurrent()
{
BOOL succeeded = sWGLLibrary.fMakeCurrent(mDC, mContext);
NS_ASSERTION(succeeded, "Failed to make GL context current!");
BOOL succeeded = PR_TRUE;
// wglGetCurrentContext seems to just pull the HGLRC out
// of its TLS slot, so no need to do our own tls slot.
// You would think that wglMakeCurrent would avoid doing
// work if mContext was already current, but not so much..
if (sWGLLibrary.fGetCurrentContext() != mContext) {
succeeded = sWGLLibrary.fMakeCurrent(mDC, mContext);
NS_ASSERTION(succeeded, "Failed to make GL context current!");
}
return succeeded;
}