Bug 977880 - Handle ReleaseFence on tiled thebes layer r=cwiiis,nical,BenWa

This commit is contained in:
Sotaro Ikeda
2014-03-26 18:01:15 -07:00
parent 9328e99862
commit 6b249a1804
21 changed files with 204 additions and 29 deletions

View File

@@ -187,6 +187,24 @@ GrallocTextureClientOGL::SetReleaseFenceHandle(FenceHandle aReleaseFenceHandle)
}
}
void
GrallocTextureClientOGL::WaitReleaseFence()
{
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
if (mReleaseFenceHandle.IsValid()) {
android::sp<Fence> fence = mReleaseFenceHandle.mFence;
#if ANDROID_VERSION == 17
fence->waitForever(1000, "GrallocTextureClientOGL::Lock");
// 1000 is what Android uses. It is warning timeout ms.
// This timeous is removed since ANDROID_VERSION 18.
#else
fence->waitForever("GrallocTextureClientOGL::Lock");
#endif
mReleaseFenceHandle = FenceHandle();
}
#endif
}
bool
GrallocTextureClientOGL::Lock(OpenMode aMode)
{
@@ -199,18 +217,7 @@ GrallocTextureClientOGL::Lock(OpenMode aMode)
return true;
}
#if MOZ_WIDGET_GONK && ANDROID_VERSION >= 17
if (mReleaseFenceHandle.IsValid()) {
android::sp<Fence> fence = mReleaseFenceHandle.mFence;
#if ANDROID_VERSION == 17
fence->waitForever(1000, "GrallocTextureClientOGL::Lock");
// 1000 is what Android uses. It is warning timeout ms.
#else
fence->waitForever("GrallocTextureClientOGL::Lock");
#endif
mReleaseFenceHandle = FenceHandle();
}
#endif
WaitReleaseFence();
uint32_t usage = 0;
if (aMode & OPEN_READ) {