fb6faaab69
chore: backport b5b8e05a8 from chromium
31 lines
1.8 KiB
Diff
31 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samuel Maddock <smaddock@slack-corp.com>
|
|
Date: Fri, 18 Oct 2024 11:11:11 -0400
|
|
Subject: fix: software compositing infinite loop
|
|
|
|
When GPU compositing is unavailable, LayerTreeView::RequestNewLayerTreeFrameSink
|
|
may run in an infinite loop due to a race condition. Need to allow time to
|
|
process CompositingModeFallbackToSoftware IPC to disable GPU compositing.
|
|
|
|
https://issues.chromium.org/345275130
|
|
|
|
diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc
|
|
index 3bbaa7dafcff1c88badaec0dbf14fd3320130398..8db903f3f343ed8723ad8adcb978b01fc27c6d9e 100644
|
|
--- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc
|
|
+++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc
|
|
@@ -375,9 +375,13 @@ void LayerTreeView::DidFailToInitializeLayerTreeFrameSink() {
|
|
// unable to be killed after Chrome is closed.
|
|
// https://issues.chromium.org/336164423
|
|
if (!Platform::Current()->IsGpuRemoteDisconnected()) {
|
|
- layer_tree_host_->GetTaskRunnerProvider()->MainThreadTaskRunner()->PostTask(
|
|
+ // CompositingModeFallbackToSoftware IPC will disable GPU compositing in
|
|
+ // RenderThread. Post task with delay to give time to receive this IPC and
|
|
+ // prevent infinite loop of retries for software renderers.
|
|
+ // https://issues.chromium.org/345275130
|
|
+ layer_tree_host_->GetTaskRunnerProvider()->MainThreadTaskRunner()->PostDelayedTask(
|
|
FROM_HERE, base::BindOnce(&LayerTreeView::RequestNewLayerTreeFrameSink,
|
|
- weak_factory_.GetWeakPtr()));
|
|
+ weak_factory_.GetWeakPtr()), base::Milliseconds(10));
|
|
}
|
|
}
|
|
|