mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1313281 - Part 5: Remove NeedsFenceHandle. r=sotaro
This commit is contained in:
parent
56b15734eb
commit
6250728c9c
@ -416,7 +416,6 @@ void TextureClient::Destroy(bool aForceSync)
|
||||
mBorrowedDrawTarget = nullptr;
|
||||
mReadLock = nullptr;
|
||||
|
||||
CancelWaitFenceHandleOnImageBridge();
|
||||
RefPtr<TextureChild> actor = mActor;
|
||||
mActor = nullptr;
|
||||
|
||||
@ -803,15 +802,6 @@ TextureClient::SetAddedToCompositableClient()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TextureClient::CancelWaitFenceHandleOnImageBridge()
|
||||
{
|
||||
if (!NeedsFenceHandle() || GetFlags() & TextureFlags::RECYCLE) {
|
||||
return;
|
||||
}
|
||||
ImageBridgeChild::GetSingleton()->CancelWaitFenceHandle(this);
|
||||
}
|
||||
|
||||
void CancelTextureClientRecycle(uint64_t aTextureId, LayersIPCChannel* aAllocator)
|
||||
{
|
||||
if (!aAllocator) {
|
||||
@ -837,7 +827,6 @@ TextureClient::CancelWaitForRecycle()
|
||||
CancelTextureClientRecycle(mSerial, GetAllocator());
|
||||
return;
|
||||
}
|
||||
CancelWaitFenceHandleOnImageBridge();
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
|
@ -613,13 +613,6 @@ public:
|
||||
|
||||
uint64_t GetSerial() const { return mSerial; }
|
||||
|
||||
bool NeedsFenceHandle()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CancelWaitFenceHandleOnImageBridge();
|
||||
|
||||
void CancelWaitForRecycle();
|
||||
|
||||
/**
|
||||
|
@ -588,8 +588,6 @@ public:
|
||||
|
||||
void SetLastFwdTransactionId(uint64_t aTransactionId);
|
||||
|
||||
virtual bool NeedsFenceHandle() { return false; }
|
||||
|
||||
void DeserializeReadLock(const ReadLockDescriptor& aDesc,
|
||||
ISurfaceAllocator* aAllocator);
|
||||
|
||||
|
@ -912,21 +912,12 @@ CompositorBridgeChild::HoldUntilCompositableRefReleasedIfNecessary(TextureClient
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(aClient->GetFlags() & TextureFlags::RECYCLE) &&
|
||||
!aClient->NeedsFenceHandle()) {
|
||||
if (!(aClient->GetFlags() & TextureFlags::RECYCLE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (aClient->GetFlags() & TextureFlags::RECYCLE) {
|
||||
aClient->SetLastFwdTransactionId(GetFwdTransactionId());
|
||||
mTexturesWaitingRecycled.Put(aClient->GetSerial(), aClient);
|
||||
return;
|
||||
}
|
||||
MOZ_ASSERT(!(aClient->GetFlags() & TextureFlags::RECYCLE));
|
||||
MOZ_ASSERT(aClient->NeedsFenceHandle());
|
||||
// Handle a case of fence delivery via ImageBridge.
|
||||
// GrallocTextureData alwasys requests fence delivery if ANDROID_VERSION >= 17.
|
||||
ImageBridgeChild::GetSingleton()->HoldUntilFenceHandleDelivery(aClient, GetFwdTransactionId());
|
||||
aClient->SetLastFwdTransactionId(GetFwdTransactionId());
|
||||
mTexturesWaitingRecycled.Put(aClient->GetSerial(), aClient);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -112,37 +112,13 @@ CompositorBridgeParentBase::NotifyNotUsed(PTextureParent* aTexture, uint64_t aTr
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(texture->GetFlags() & TextureFlags::RECYCLE) &&
|
||||
!texture->NeedsFenceHandle()) {
|
||||
if (!(texture->GetFlags() & TextureFlags::RECYCLE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (texture->GetFlags() & TextureFlags::RECYCLE) {
|
||||
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
||||
mPendingAsyncMessage.push_back(
|
||||
OpNotifyNotUsed(textureId, aTransactionId));
|
||||
return;
|
||||
}
|
||||
|
||||
// Gralloc requests to deliver fence to client side.
|
||||
// If client side does not use TextureFlags::RECYCLE flag,
|
||||
// The fence can not be delivered via LayerTransactionParent.
|
||||
// TextureClient might wait the fence delivery on main thread.
|
||||
|
||||
MOZ_ASSERT(ImageBridgeParent::GetInstance(GetChildProcessId()));
|
||||
if (ImageBridgeParent::GetInstance(GetChildProcessId())) {
|
||||
// Send message back via PImageBridge.
|
||||
ImageBridgeParent::NotifyNotUsedToNonRecycle(
|
||||
GetChildProcessId(),
|
||||
aTexture,
|
||||
aTransactionId);
|
||||
} else {
|
||||
NS_ERROR("ImageBridgeParent should exist");
|
||||
}
|
||||
|
||||
if (!IsAboutToSendAsyncMessages()) {
|
||||
SendPendingAsyncMessages();
|
||||
}
|
||||
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
||||
mPendingAsyncMessage.push_back(
|
||||
OpNotifyNotUsed(textureId, aTransactionId));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -243,34 +243,6 @@ ImageBridgeChild::NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId)
|
||||
mTexturesWaitingRecycled.Remove(aTextureId);
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::HoldUntilFenceHandleDelivery(TextureClient* aClient, uint64_t aTransactionId)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
// XXX Re-enable fence handling
|
||||
return;
|
||||
|
||||
NS_RUNTIMEABORT("not reached");
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::NotifyNotUsedToNonRecycle(uint64_t aTextureId, uint64_t aTransactionId)
|
||||
{
|
||||
// XXX Re-enable fence handling
|
||||
return;
|
||||
|
||||
NS_RUNTIMEABORT("not reached");
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::CancelWaitFenceHandle(TextureClient* aClient)
|
||||
{
|
||||
// XXX Re-enable fence handling
|
||||
return;
|
||||
|
||||
NS_RUNTIMEABORT("not reached");
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::CancelWaitForRecycle(uint64_t aTextureId)
|
||||
{
|
||||
@ -1185,16 +1157,6 @@ ImageBridgeChild::RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageDat
|
||||
NotifyNotUsed(op.TextureId(), op.fwdTransactionId());
|
||||
break;
|
||||
}
|
||||
case AsyncParentMessageData::TOpNotifyNotUsedToNonRecycle: {
|
||||
// Notify ReleaseCompositableRef to a TextureClient that belongs to
|
||||
// LayerTransactionChild. It is used only on gonk to deliver fence to
|
||||
// a TextureClient that does not have TextureFlags::RECYCLE.
|
||||
// In this case, LayerTransactionChild's ipc could not be used to deliver fence.
|
||||
|
||||
const OpNotifyNotUsedToNonRecycle& op = message.get_OpNotifyNotUsedToNonRecycle();
|
||||
NotifyNotUsedToNonRecycle(op.TextureId(), op.fwdTransactionId());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
NS_ERROR("unknown AsyncParentMessageData type");
|
||||
return false;
|
||||
|
@ -291,12 +291,6 @@ public:
|
||||
*/
|
||||
void NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId);
|
||||
|
||||
void HoldUntilFenceHandleDelivery(TextureClient* aClient, uint64_t aTransactionId);
|
||||
|
||||
void NotifyNotUsedToNonRecycle(uint64_t aTextureId, uint64_t aTransactionId);
|
||||
|
||||
void CancelWaitFenceHandle(TextureClient* aClient);
|
||||
|
||||
virtual void CancelWaitForRecycle(uint64_t aTextureId) override;
|
||||
|
||||
virtual bool DestroyInTransaction(PTextureChild* aTexture, bool synchronously) override;
|
||||
|
@ -407,38 +407,6 @@ bool ImageBridgeParent::IsSameProcess() const
|
||||
return OtherPid() == base::GetCurrentProcId();
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeParent::NotifyNotUsedToNonRecycle(PTextureParent* aTexture,
|
||||
uint64_t aTransactionId)
|
||||
{
|
||||
RefPtr<TextureHost> texture = TextureHost::AsTextureHost(aTexture);
|
||||
if (!texture) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(texture->GetFlags() & TextureFlags::RECYCLE) &&
|
||||
!texture->NeedsFenceHandle()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
||||
mPendingAsyncMessage.push_back(
|
||||
OpNotifyNotUsedToNonRecycle(textureId, aTransactionId));
|
||||
|
||||
}
|
||||
|
||||
/*static*/ void
|
||||
ImageBridgeParent::NotifyNotUsedToNonRecycle(base::ProcessId aChildProcessId,
|
||||
PTextureParent* aTexture,
|
||||
uint64_t aTransactionId)
|
||||
{
|
||||
ImageBridgeParent* imageBridge = ImageBridgeParent::GetInstance(aChildProcessId);
|
||||
if (!imageBridge) {
|
||||
return;
|
||||
}
|
||||
imageBridge->NotifyNotUsedToNonRecycle(aTexture, aTransactionId);
|
||||
}
|
||||
|
||||
/*static*/ void
|
||||
ImageBridgeParent::SetAboutToSendAsyncMessages(base::ProcessId aChildProcessId)
|
||||
{
|
||||
@ -467,8 +435,7 @@ ImageBridgeParent::NotifyNotUsed(PTextureParent* aTexture, uint64_t aTransaction
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(texture->GetFlags() & TextureFlags::RECYCLE) &&
|
||||
!texture->NeedsFenceHandle()) {
|
||||
if (!(texture->GetFlags() & TextureFlags::RECYCLE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -113,13 +113,6 @@ public:
|
||||
|
||||
virtual bool IsSameProcess() const override;
|
||||
|
||||
void NotifyNotUsedToNonRecycle(PTextureParent* aTexture,
|
||||
uint64_t aTransactionId);
|
||||
|
||||
static void NotifyNotUsedToNonRecycle(base::ProcessId aChildProcessId,
|
||||
PTextureParent* aTexture,
|
||||
uint64_t aTransactionId);
|
||||
|
||||
using CompositableParentManager::SetAboutToSendAsyncMessages;
|
||||
static void SetAboutToSendAsyncMessages(base::ProcessId aChildProcessId);
|
||||
|
||||
|
@ -414,11 +414,6 @@ struct OpNotifyNotUsed {
|
||||
uint64_t fwdTransactionId;
|
||||
};
|
||||
|
||||
struct OpNotifyNotUsedToNonRecycle {
|
||||
uint64_t TextureId;
|
||||
uint64_t fwdTransactionId;
|
||||
};
|
||||
|
||||
union CompositableOperationDetail {
|
||||
OpPaintTextureRegion;
|
||||
|
||||
@ -498,7 +493,6 @@ union EditReply {
|
||||
|
||||
union AsyncParentMessageData {
|
||||
OpNotifyNotUsed;
|
||||
OpNotifyNotUsedToNonRecycle;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
Loading…
Reference in New Issue
Block a user