Bug 1899096 - Update FwdTransactionTracker::mFwdTransactionId in ShareableCanvasRenderer::UpdateCompositableClient() even when canvas is not dirty r=gfx-reviewers,lsalzman

ShareableCanvasRenderer::UpdateCompositableClient() does not update FwdTransactionTracker::mFwdTransactionId when canvas is not dirty. It caused small emoteTextureTxnId in RecordedTextureData::~RecordedTextureData(). It caused too early remote texture owner removal. And it caused Bug 1898650 comment 2.

Differential Revision: https://phabricator.services.mozilla.com/D211713
This commit is contained in:
sotaro
2024-05-27 16:39:17 +00:00
parent 132d9f5905
commit 746121ba67
2 changed files with 13 additions and 3 deletions

View File

@@ -88,6 +88,16 @@ void ShareableCanvasRenderer::UpdateCompositableClient() {
}
if (!IsDirty()) {
const auto context = mData.GetContext();
if (!context) {
return;
}
const auto& forwarder = GetForwarder();
RefPtr<FwdTransactionTracker> tracker =
context->UseCompositableForwarder(forwarder);
if (forwarder && tracker) {
forwarder->TrackFwdTransaction(tracker);
}
return;
}
ResetDirty();

View File

@@ -174,15 +174,15 @@ class CompositableForwarder : public KnowsCompositor {
void AssertInForwarderThread() { MOZ_ASSERT(InForwarderThread()); }
protected:
virtual FwdTransactionCounter& GetFwdTransactionCounter() = 0;
void TrackFwdTransaction(const RefPtr<FwdTransactionTracker>& aTracker) {
if (aTracker) {
aTracker->Use(GetFwdTransactionCounter());
}
}
protected:
virtual FwdTransactionCounter& GetFwdTransactionCounter() = 0;
nsTArray<RefPtr<TextureClient>> mTexturesToRemove;
nsTArray<RefPtr<CompositableClient>> mCompositableClientsToRemove;
};