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:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user