mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-25 01:01:52 +00:00
Backed out changeset 34f9b78948b9 (bug 999694) for gl bustage on a CLOSED TREE
This commit is contained in:
parent
54f2dadcee
commit
2c87ffa6b4
@ -31,7 +31,6 @@ static const char *sEGLExtensionNames[] = {
|
||||
"EGL_EXT_create_context_robustness",
|
||||
"EGL_KHR_image",
|
||||
"EGL_KHR_fence_sync",
|
||||
"EGL_ANDROID_native_fence_sync",
|
||||
nullptr
|
||||
};
|
||||
|
||||
@ -196,10 +195,6 @@ GLLibraryEGL::EnsureInitialized()
|
||||
SYMBOL(GetProcAddress),
|
||||
SYMBOL(SwapBuffers),
|
||||
SYMBOL(CopyBuffers),
|
||||
// On Android 4.2 and up, certain features like ANDROID_native_fence_sync
|
||||
// can only be queried by using a special eglQueryString.
|
||||
{ (PRFuncPtr*) &mSymbols.fQueryStringImplementationANDROID,
|
||||
{ "_Z35eglQueryStringImplementationANDROIDPvi", nullptr } },
|
||||
SYMBOL(QueryString),
|
||||
SYMBOL(QueryContext),
|
||||
SYMBOL(BindTexImage),
|
||||
@ -213,11 +208,6 @@ GLLibraryEGL::EnsureInitialized()
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
|
||||
MOZ_RELEASE_ASSERT(mSymbols.fQueryStringImplementationANDROID,
|
||||
"Couldn't find eglQueryStringImplementationANDROID");
|
||||
#endif
|
||||
|
||||
mEGLDisplay = fGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
if (!fInitialize(mEGLDisplay, nullptr, nullptr))
|
||||
return false;
|
||||
|
@ -117,7 +117,6 @@ public:
|
||||
EXT_create_context_robustness,
|
||||
KHR_image,
|
||||
KHR_fence_sync,
|
||||
ANDROID_native_fence_sync,
|
||||
Extensions_Max
|
||||
};
|
||||
|
||||
@ -297,12 +296,7 @@ public:
|
||||
const GLubyte* fQueryString(EGLDisplay dpy, EGLint name)
|
||||
{
|
||||
BEFORE_GL_CALL;
|
||||
const GLubyte* b;
|
||||
if (mSymbols.fQueryStringImplementationANDROID) {
|
||||
b = mSymbols.fQueryStringImplementationANDROID(dpy, name);
|
||||
} else {
|
||||
b = mSymbols.fQueryString(dpy, name);
|
||||
}
|
||||
const GLubyte* b = mSymbols.fQueryString(dpy, name);
|
||||
AFTER_GL_CALL;
|
||||
return b;
|
||||
}
|
||||
@ -490,7 +484,6 @@ public:
|
||||
pfnCopyBuffers fCopyBuffers;
|
||||
typedef const GLubyte* (GLAPIENTRY * pfnQueryString)(EGLDisplay, EGLint name);
|
||||
pfnQueryString fQueryString;
|
||||
pfnQueryString fQueryStringImplementationANDROID;
|
||||
typedef EGLBoolean (GLAPIENTRY * pfnQueryContext)(EGLDisplay dpy, EGLContext ctx,
|
||||
EGLint attribute, EGLint *value);
|
||||
pfnQueryContext fQueryContext;
|
||||
|
@ -132,46 +132,11 @@ SharedSurface_Gralloc::~SharedSurface_Gralloc()
|
||||
|
||||
mGL->MakeCurrent();
|
||||
mGL->fDeleteTextures(1, &mProdTex);
|
||||
|
||||
if (mSync) {
|
||||
MOZ_ALWAYS_TRUE( mEGL->fDestroySync(mEGL->Display(), mSync) );
|
||||
mSync = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SharedSurface_Gralloc::Fence()
|
||||
{
|
||||
if (mSync) {
|
||||
MOZ_ALWAYS_TRUE( mEGL->fDestroySync(mEGL->Display(), mSync) );
|
||||
mSync = 0;
|
||||
}
|
||||
|
||||
// When Android native fences are available, try
|
||||
// them first since they're more likely to work.
|
||||
// Android native fences are also likely to perform better.
|
||||
if (mEGL->IsExtensionSupported(GLLibraryEGL::ANDROID_native_fence_sync)) {
|
||||
mGL->MakeCurrent();
|
||||
mSync = mEGL->fCreateSync(mEGL->Display(),
|
||||
LOCAL_EGL_SYNC_NATIVE_FENCE_ANDROID,
|
||||
nullptr);
|
||||
if (mSync) {
|
||||
mGL->fFlush();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (mEGL->IsExtensionSupported(GLLibraryEGL::KHR_fence_sync)) {
|
||||
mGL->MakeCurrent();
|
||||
mSync = mEGL->fCreateSync(mEGL->Display(),
|
||||
LOCAL_EGL_SYNC_FENCE,
|
||||
nullptr);
|
||||
if (mSync) {
|
||||
mGL->fFlush();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// We should be able to rely on genlock write locks/read locks.
|
||||
// But they're broken on some configs, and even a glFinish doesn't
|
||||
// work. glReadPixels seems to, though.
|
||||
@ -186,23 +151,5 @@ SharedSurface_Gralloc::Fence()
|
||||
bool
|
||||
SharedSurface_Gralloc::WaitSync()
|
||||
{
|
||||
if (!mSync) {
|
||||
// We must not be needed.
|
||||
return true;
|
||||
}
|
||||
MOZ_ASSERT(mEGL->IsExtensionSupported(GLLibraryEGL::KHR_fence_sync));
|
||||
|
||||
EGLint status = mEGL->fClientWaitSync(mEGL->Display(),
|
||||
mSync,
|
||||
0,
|
||||
LOCAL_EGL_FOREVER);
|
||||
|
||||
if (status != LOCAL_EGL_CONDITION_SATISFIED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_TRUE( mEGL->fDestroySync(mEGL->Display(), mSync) );
|
||||
mSync = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ public:
|
||||
|
||||
protected:
|
||||
GLLibraryEGL* const mEGL;
|
||||
EGLSync mSync;
|
||||
RefPtr<layers::ISurfaceAllocator> mAllocator;
|
||||
RefPtr<layers::TextureClient> mTextureClient;
|
||||
const GLuint mProdTex;
|
||||
@ -56,7 +55,6 @@ protected:
|
||||
size,
|
||||
hasAlpha)
|
||||
, mEGL(egl)
|
||||
, mSync(0)
|
||||
, mAllocator(allocator)
|
||||
, mTextureClient(textureClient)
|
||||
, mProdTex(prodTex)
|
||||
|
Loading…
Reference in New Issue
Block a user