b=567272; wglMakeCurrent is expensive; r=bas

This commit is contained in:
Vladimir Vukicevic 2010-05-20 17:20:39 -07:00
Родитель 25071d58a5
Коммит e163e03a8f
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -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;
}