зеркало из https://github.com/mozilla/pjs.git
Bug 596544 - These WebGL samples are slow on Firefox, fast on Chrome - r=vladimir, a=joe
This commit is contained in:
Родитель
e003bfb674
Коммит
131b175130
|
@ -98,6 +98,7 @@ GLXLibrary::EnsureInitialized()
|
|||
{ (PRFuncPtr*) &xDestroyPixmap, { "glXDestroyPixmap", NULL } },
|
||||
{ (PRFuncPtr*) &xGetClientString, { "glXGetClientString", NULL } },
|
||||
{ (PRFuncPtr*) &xCreateContext, { "glXCreateContext", NULL } },
|
||||
{ (PRFuncPtr*) &xGetCurrentContext, { "glXGetCurrentContext", NULL } },
|
||||
{ NULL, { NULL } }
|
||||
};
|
||||
|
||||
|
@ -254,8 +255,19 @@ TRY_AGAIN_NO_SHARING:
|
|||
|
||||
PRBool MakeCurrent(PRBool aForce = PR_FALSE)
|
||||
{
|
||||
Bool succeeded = sGLXLibrary.xMakeCurrent(mDisplay, mDrawable, mContext);
|
||||
NS_ASSERTION(succeeded, "Failed to make GL context current!");
|
||||
PRBool succeeded = PR_TRUE;
|
||||
|
||||
// With the ATI FGLRX driver, glxMakeCurrent is very slow even when the context doesn't change.
|
||||
// (This is not the case with other drivers such as NVIDIA).
|
||||
// So avoid calling it more than necessary. Since GLX documentation says that:
|
||||
// "glXGetCurrentContext returns client-side information.
|
||||
// It does not make a round trip to the server."
|
||||
// I assume that it's not worth using our own TLS slot here.
|
||||
if (aForce || sGLXLibrary.xGetCurrentContext() != mContext) {
|
||||
succeeded = sGLXLibrary.xMakeCurrent(mDisplay, mDrawable, mContext);
|
||||
NS_ASSERTION(succeeded, "Failed to make GL context current!");
|
||||
}
|
||||
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,8 @@ public:
|
|||
GLXDrawable,
|
||||
GLXContext);
|
||||
PFNGLXMAKECURRENTPROC xMakeCurrent;
|
||||
typedef GLXContext (GLAPIENTRY * PFNGLXGETCURRENTCONTEXT) ();
|
||||
PFNGLXGETCURRENTCONTEXT xGetCurrentContext;
|
||||
typedef void* (GLAPIENTRY * PFNGLXGETPROCADDRESSPROC) (const char *);
|
||||
PFNGLXGETPROCADDRESSPROC xGetProcAddress;
|
||||
typedef XVisualInfo* (GLAPIENTRY * PFNGLXCHOOSEVISUALPROC) (Display*,
|
||||
|
|
Загрузка…
Ссылка в новой задаче