зеркало из https://github.com/mozilla/gecko-dev.git
b=567272; wglMakeCurrent is expensive; r=bas
This commit is contained in:
Родитель
25071d58a5
Коммит
e163e03a8f
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче