зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1313281 - Part 5: Remove NeedsFenceHandle. r=sotaro
This commit is contained in:
Родитель
56b15734eb
Коммит
6250728c9c
|
@ -416,7 +416,6 @@ void TextureClient::Destroy(bool aForceSync)
|
||||||
mBorrowedDrawTarget = nullptr;
|
mBorrowedDrawTarget = nullptr;
|
||||||
mReadLock = nullptr;
|
mReadLock = nullptr;
|
||||||
|
|
||||||
CancelWaitFenceHandleOnImageBridge();
|
|
||||||
RefPtr<TextureChild> actor = mActor;
|
RefPtr<TextureChild> actor = mActor;
|
||||||
mActor = nullptr;
|
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)
|
void CancelTextureClientRecycle(uint64_t aTextureId, LayersIPCChannel* aAllocator)
|
||||||
{
|
{
|
||||||
if (!aAllocator) {
|
if (!aAllocator) {
|
||||||
|
@ -837,7 +827,6 @@ TextureClient::CancelWaitForRecycle()
|
||||||
CancelTextureClientRecycle(mSerial, GetAllocator());
|
CancelTextureClientRecycle(mSerial, GetAllocator());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CancelWaitFenceHandleOnImageBridge();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void
|
/* static */ void
|
||||||
|
|
|
@ -613,13 +613,6 @@ public:
|
||||||
|
|
||||||
uint64_t GetSerial() const { return mSerial; }
|
uint64_t GetSerial() const { return mSerial; }
|
||||||
|
|
||||||
bool NeedsFenceHandle()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CancelWaitFenceHandleOnImageBridge();
|
|
||||||
|
|
||||||
void CancelWaitForRecycle();
|
void CancelWaitForRecycle();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -588,8 +588,6 @@ public:
|
||||||
|
|
||||||
void SetLastFwdTransactionId(uint64_t aTransactionId);
|
void SetLastFwdTransactionId(uint64_t aTransactionId);
|
||||||
|
|
||||||
virtual bool NeedsFenceHandle() { return false; }
|
|
||||||
|
|
||||||
void DeserializeReadLock(const ReadLockDescriptor& aDesc,
|
void DeserializeReadLock(const ReadLockDescriptor& aDesc,
|
||||||
ISurfaceAllocator* aAllocator);
|
ISurfaceAllocator* aAllocator);
|
||||||
|
|
||||||
|
|
|
@ -912,21 +912,12 @@ CompositorBridgeChild::HoldUntilCompositableRefReleasedIfNecessary(TextureClient
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(aClient->GetFlags() & TextureFlags::RECYCLE) &&
|
if (!(aClient->GetFlags() & TextureFlags::RECYCLE)) {
|
||||||
!aClient->NeedsFenceHandle()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aClient->GetFlags() & TextureFlags::RECYCLE) {
|
aClient->SetLastFwdTransactionId(GetFwdTransactionId());
|
||||||
aClient->SetLastFwdTransactionId(GetFwdTransactionId());
|
mTexturesWaitingRecycled.Put(aClient->GetSerial(), aClient);
|
||||||
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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -112,37 +112,13 @@ CompositorBridgeParentBase::NotifyNotUsed(PTextureParent* aTexture, uint64_t aTr
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(texture->GetFlags() & TextureFlags::RECYCLE) &&
|
if (!(texture->GetFlags() & TextureFlags::RECYCLE)) {
|
||||||
!texture->NeedsFenceHandle()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture->GetFlags() & TextureFlags::RECYCLE) {
|
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
||||||
uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
|
mPendingAsyncMessage.push_back(
|
||||||
mPendingAsyncMessage.push_back(
|
OpNotifyNotUsed(textureId, aTransactionId));
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -243,34 +243,6 @@ ImageBridgeChild::NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId)
|
||||||
mTexturesWaitingRecycled.Remove(aTextureId);
|
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
|
void
|
||||||
ImageBridgeChild::CancelWaitForRecycle(uint64_t aTextureId)
|
ImageBridgeChild::CancelWaitForRecycle(uint64_t aTextureId)
|
||||||
{
|
{
|
||||||
|
@ -1185,16 +1157,6 @@ ImageBridgeChild::RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageDat
|
||||||
NotifyNotUsed(op.TextureId(), op.fwdTransactionId());
|
NotifyNotUsed(op.TextureId(), op.fwdTransactionId());
|
||||||
break;
|
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:
|
default:
|
||||||
NS_ERROR("unknown AsyncParentMessageData type");
|
NS_ERROR("unknown AsyncParentMessageData type");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -291,12 +291,6 @@ public:
|
||||||
*/
|
*/
|
||||||
void NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId);
|
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 void CancelWaitForRecycle(uint64_t aTextureId) override;
|
||||||
|
|
||||||
virtual bool DestroyInTransaction(PTextureChild* aTexture, bool synchronously) override;
|
virtual bool DestroyInTransaction(PTextureChild* aTexture, bool synchronously) override;
|
||||||
|
|
|
@ -407,38 +407,6 @@ bool ImageBridgeParent::IsSameProcess() const
|
||||||
return OtherPid() == base::GetCurrentProcId();
|
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
|
/*static*/ void
|
||||||
ImageBridgeParent::SetAboutToSendAsyncMessages(base::ProcessId aChildProcessId)
|
ImageBridgeParent::SetAboutToSendAsyncMessages(base::ProcessId aChildProcessId)
|
||||||
{
|
{
|
||||||
|
@ -467,8 +435,7 @@ ImageBridgeParent::NotifyNotUsed(PTextureParent* aTexture, uint64_t aTransaction
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(texture->GetFlags() & TextureFlags::RECYCLE) &&
|
if (!(texture->GetFlags() & TextureFlags::RECYCLE)) {
|
||||||
!texture->NeedsFenceHandle()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,13 +113,6 @@ public:
|
||||||
|
|
||||||
virtual bool IsSameProcess() const override;
|
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;
|
using CompositableParentManager::SetAboutToSendAsyncMessages;
|
||||||
static void SetAboutToSendAsyncMessages(base::ProcessId aChildProcessId);
|
static void SetAboutToSendAsyncMessages(base::ProcessId aChildProcessId);
|
||||||
|
|
||||||
|
|
|
@ -414,11 +414,6 @@ struct OpNotifyNotUsed {
|
||||||
uint64_t fwdTransactionId;
|
uint64_t fwdTransactionId;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct OpNotifyNotUsedToNonRecycle {
|
|
||||||
uint64_t TextureId;
|
|
||||||
uint64_t fwdTransactionId;
|
|
||||||
};
|
|
||||||
|
|
||||||
union CompositableOperationDetail {
|
union CompositableOperationDetail {
|
||||||
OpPaintTextureRegion;
|
OpPaintTextureRegion;
|
||||||
|
|
||||||
|
@ -498,7 +493,6 @@ union EditReply {
|
||||||
|
|
||||||
union AsyncParentMessageData {
|
union AsyncParentMessageData {
|
||||||
OpNotifyNotUsed;
|
OpNotifyNotUsed;
|
||||||
OpNotifyNotUsedToNonRecycle;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Загрузка…
Ссылка в новой задаче