Skip to content

Commit 0f2cd61

Browse files
Alexandru Marcamarc-mozilla
authored andcommitted
Revert "Bug 1982053 - Don't remove pipelines in offscreen transactions. r=emilio" for causing mochitest crashes @ mozilla::ipc::FatalError
This reverts commit 41d77dd.
1 parent 4a3f03c commit 0f2cd61

File tree

2 files changed

+5
-31
lines changed

2 files changed

+5
-31
lines changed

gfx/layers/wr/WebRenderBridgeChild.cpp

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,6 @@ void WebRenderBridgeChild::AddWebRenderParentCommand(
7676
mParentCommands.AppendElement(aCmd);
7777
}
7878

79-
void WebRenderBridgeChild::AddWebRenderParentDestroyCommand(
80-
const WebRenderParentCommand& aCmd) {
81-
mParentDestroyCommands.AppendElement(aCmd);
82-
}
83-
84-
void WebRenderBridgeChild::MergeWebRenderParentCommands() {
85-
mParentCommands.AppendElements(std::move(mParentDestroyCommands));
86-
mParentDestroyCommands.Clear();
87-
}
88-
8979
void WebRenderBridgeChild::BeginTransaction() {
9080
MOZ_ASSERT(!mDestroyed);
9181

@@ -124,9 +114,6 @@ bool WebRenderBridgeChild::EndTransaction(
124114

125115
TimeStamp fwdTime = TimeStamp::Now();
126116

127-
if (!aRenderOffscreen) {
128-
MergeWebRenderParentCommands();
129-
}
130117
aDisplayListData.mCommands = std::move(mParentCommands);
131118
aDisplayListData.mIdNamespace = mIdNamespace;
132119

@@ -164,7 +151,6 @@ void WebRenderBridgeChild::EndEmptyTransaction(
164151
TimeStamp fwdTime = TimeStamp::Now();
165152

166153
if (aTransactionData) {
167-
MergeWebRenderParentCommands();
168154
aTransactionData->mCommands = std::move(mParentCommands);
169155
}
170156

@@ -189,8 +175,7 @@ void WebRenderBridgeChild::EndEmptyTransaction(
189175
void WebRenderBridgeChild::ProcessWebRenderParentCommands() {
190176
MOZ_ASSERT(!mDestroyed);
191177

192-
if (HasWebRenderParentCommands()) {
193-
MergeWebRenderParentCommands();
178+
if (!mParentCommands.IsEmpty()) {
194179
this->SendParentCommands(mIdNamespace, mParentCommands);
195180
mParentCommands.Clear();
196181
}
@@ -205,8 +190,7 @@ void WebRenderBridgeChild::AddPipelineIdForCompositable(
205190

206191
void WebRenderBridgeChild::RemovePipelineIdForCompositable(
207192
const wr::PipelineId& aPipelineId) {
208-
AddWebRenderParentDestroyCommand(
209-
OpRemovePipelineIdForCompositable(aPipelineId));
193+
AddWebRenderParentCommand(OpRemovePipelineIdForCompositable(aPipelineId));
210194
}
211195

212196
wr::ExternalImageId WebRenderBridgeChild::GetNextExternalImageId() {
@@ -217,7 +201,7 @@ wr::ExternalImageId WebRenderBridgeChild::GetNextExternalImageId() {
217201
}
218202

219203
void WebRenderBridgeChild::ReleaseTextureOfImage(const wr::ImageKey& aKey) {
220-
AddWebRenderParentDestroyCommand(OpReleaseTextureOfImage(aKey));
204+
AddWebRenderParentCommand(OpReleaseTextureOfImage(aKey));
221205
}
222206

223207
struct FontFileDataSink {
@@ -428,7 +412,7 @@ void WebRenderBridgeChild::RemoveTextureFromCompositable(
428412
return;
429413
}
430414

431-
AddWebRenderParentDestroyCommand(CompositableOperation(
415+
AddWebRenderParentCommand(CompositableOperation(
432416
aCompositable->GetIPCHandle(),
433417
OpRemoveTexture(WrapNotNull(aTexture->GetIPDLActor()))));
434418
}

gfx/layers/wr/WebRenderBridgeChild.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,7 @@ class WebRenderBridgeChild final : public PWebRenderBridgeChild,
6565
explicit WebRenderBridgeChild(const wr::PipelineId& aPipelineId);
6666

6767
void AddWebRenderParentCommand(const WebRenderParentCommand& aCmd);
68-
/// Similar to AddWebRenderParentCommand, with the exception that ops are not
69-
/// picked up by off-screen transactions. Typically useful for operations that
70-
/// remove resources and should not be applied before we have un-referenced
71-
/// the resources from the main display list.
72-
void AddWebRenderParentDestroyCommand(const WebRenderParentCommand& aCmd);
73-
bool HasWebRenderParentCommands() {
74-
return !mParentCommands.IsEmpty() && !mParentDestroyCommands.IsEmpty();
75-
}
68+
bool HasWebRenderParentCommands() { return !mParentCommands.IsEmpty(); }
7669

7770
void UpdateResources(wr::IpcResourceUpdateQueue& aResources);
7871
void BeginTransaction();
@@ -197,8 +190,6 @@ class WebRenderBridgeChild final : public PWebRenderBridgeChild,
197190

198191
~WebRenderBridgeChild();
199192

200-
void MergeWebRenderParentCommands();
201-
202193
wr::ExternalImageId GetNextExternalImageId();
203194

204195
// CompositableForwarder
@@ -245,7 +236,6 @@ class WebRenderBridgeChild final : public PWebRenderBridgeChild,
245236

246237
nsTArray<OpDestroy> mDestroyedActors;
247238
nsTArray<WebRenderParentCommand> mParentCommands;
248-
nsTArray<WebRenderParentCommand> mParentDestroyCommands;
249239
nsTHashMap<nsUint64HashKey, CompositableClient*> mCompositables;
250240
bool mIsInTransaction;
251241
bool mIsInClearCachedResources;

0 commit comments

Comments
 (0)