Bug 1667927 - Do not close file descriptor of android::Fence if EGLSync is created r=jnicol
When EGLSync is created from fence file descriptor, gecko should not close it. It should be closed by gecko only when EGLSync creation is failed. Differential Revision: https://phabricator.services.mozilla.com/D91702
This commit is contained in:
@@ -868,6 +868,9 @@ bool AndroidHardwareBufferTextureHost::Lock() {
|
|||||||
EGLSync sync =
|
EGLSync sync =
|
||||||
egl->fCreateSync(LOCAL_EGL_SYNC_NATIVE_FENCE_ANDROID, attribs);
|
egl->fCreateSync(LOCAL_EGL_SYNC_NATIVE_FENCE_ANDROID, attribs);
|
||||||
if (sync) {
|
if (sync) {
|
||||||
|
// Release fd here, since it is owned by EGLSync
|
||||||
|
Unused << rawFD.release();
|
||||||
|
|
||||||
egl->fClientWaitSync(sync, 0, LOCAL_EGL_FOREVER);
|
egl->fClientWaitSync(sync, 0, LOCAL_EGL_FOREVER);
|
||||||
egl->fDestroySync(sync);
|
egl->fDestroySync(sync);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ bool RenderAndroidHardwareBufferTextureHost::EnsureLockable(
|
|||||||
EGLSync sync =
|
EGLSync sync =
|
||||||
egl->fCreateSync(LOCAL_EGL_SYNC_NATIVE_FENCE_ANDROID, attribs);
|
egl->fCreateSync(LOCAL_EGL_SYNC_NATIVE_FENCE_ANDROID, attribs);
|
||||||
if (sync) {
|
if (sync) {
|
||||||
|
// Release fd here, since it is owned by EGLSync
|
||||||
|
Unused << rawFD.release();
|
||||||
|
|
||||||
// XXX use eglWaitSyncKHR() if possible. See Bug 1661371.
|
// XXX use eglWaitSyncKHR() if possible. See Bug 1661371.
|
||||||
egl->fClientWaitSync(sync, 0, LOCAL_EGL_FOREVER);
|
egl->fClientWaitSync(sync, 0, LOCAL_EGL_FOREVER);
|
||||||
egl->fDestroySync(sync);
|
egl->fDestroySync(sync);
|
||||||
|
|||||||
Reference in New Issue
Block a user