зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1024144 - Deliver acquire fence to HwComposer r=sushil,nical
This commit is contained in:
Родитель
ae52da58ae
Коммит
8364b31b70
|
@ -144,6 +144,13 @@ GrallocTextureSourceOGL::BindTexture(GLenum aTextureUnit, gfx::Filter aFilter)
|
|||
}
|
||||
|
||||
ApplyFilterToBoundTexture(gl(), aFilter, textureTarget);
|
||||
|
||||
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
|
||||
if (mTextureHost) {
|
||||
// Wait until it's ready.
|
||||
mTextureHost->WaitAcquireFenceSyncComplete();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void GrallocTextureSourceOGL::Lock()
|
||||
|
@ -443,12 +450,6 @@ GrallocTextureSourceOGL::GetGLTexture()
|
|||
void
|
||||
GrallocTextureSourceOGL::BindEGLImage()
|
||||
{
|
||||
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
|
||||
if (mTextureHost) {
|
||||
mTextureHost->WaitAcquireFenceSyncComplete();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mCompositableBackendData) {
|
||||
CompositableDataGonkOGL* backend = static_cast<CompositableDataGonkOGL*>(mCompositableBackendData.get());
|
||||
backend->BindEGLImage(GetTextureTarget(), mEGLImage);
|
||||
|
|
|
@ -229,9 +229,12 @@ TextureHostOGL::SetAcquireFence(const android::sp<android::Fence>& aAcquireFence
|
|||
}
|
||||
|
||||
android::sp<android::Fence>
|
||||
TextureHostOGL::GetAcquireFence()
|
||||
TextureHostOGL::GetAndResetAcquireFence()
|
||||
{
|
||||
return mAcquireFence;
|
||||
android::sp<android::Fence> fence = mAcquireFence;
|
||||
// Reset current AcquireFence.
|
||||
mAcquireFence = android::Fence::NO_FENCE;
|
||||
return fence;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -174,7 +174,10 @@ public:
|
|||
|
||||
virtual void SetAcquireFence(const android::sp<android::Fence>& aAcquireFence);
|
||||
|
||||
virtual android::sp<android::Fence> GetAcquireFence();
|
||||
/**
|
||||
* Return a acquireFence's Fence and clear a reference to the Fence.
|
||||
*/
|
||||
virtual android::sp<android::Fence> GetAndResetAcquireFence();
|
||||
|
||||
virtual void WaitAcquireFenceSyncComplete();
|
||||
|
||||
|
|
|
@ -682,6 +682,25 @@ HwcComposer2D::Commit()
|
|||
hwc_display_contents_1_t *displays[HWC_NUM_DISPLAY_TYPES] = { nullptr };
|
||||
displays[HWC_DISPLAY_PRIMARY] = mList;
|
||||
|
||||
for (uint32_t j=0; j < (mList->numHwLayers - 1); j++) {
|
||||
if (!mHwcLayerMap[j] ||
|
||||
(mList->hwLayers[j].compositionType == HWC_FRAMEBUFFER)) {
|
||||
continue;
|
||||
}
|
||||
LayerRenderState state = mHwcLayerMap[j]->GetLayer()->GetRenderState();
|
||||
if (!state.mTexture) {
|
||||
continue;
|
||||
}
|
||||
TextureHostOGL* texture = state.mTexture->AsHostOGL();
|
||||
if (!texture) {
|
||||
continue;
|
||||
}
|
||||
sp<Fence> fence = texture->GetAndResetAcquireFence();
|
||||
if (fence.get() && fence->isValid()) {
|
||||
mList->hwLayers[j].acquireFenceFd = fence->dup();
|
||||
}
|
||||
}
|
||||
|
||||
int err = mHwc->set(mHwc, HWC_NUM_DISPLAY_TYPES, displays);
|
||||
|
||||
mPrevDisplayFence = mPrevRetireFence;
|
||||
|
|
Загрузка…
Ссылка в новой задаче