electron/patches/chromium/disable_compositor_recycling.patch
trop[bot] dbd7840254
chore: bump chromium to 130.0.6669.0 (33-x-y) (#43403)
* chore: bump chromium in DEPS to 130.0.6669.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* 5789734: Consolidate all the accessibility scale factor utility code into one file

https://chromium-review.googlesource.com/c/chromium/src/+/5789734

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 5798543: [autofill] Don't emit autofill audit reports if inspector not connected

https://chromium-review.googlesource.com/c/chromium/src/+/5798543

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 5797073: [wasm] Spill all loop inputs before entering loop

https://chromium-review.googlesource.com/c/v8/v8/+/5797073

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: fixup patch indices

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 5795224: Version 13.0.0

https://chromium-review.googlesource.com/c/v8/v8/+/5795224

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-08-21 20:20:13 +02:00

24 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Locascio <andy@slack-corp.com>
Date: Wed, 21 Aug 2019 12:09:10 -0700
Subject: fix: disabling compositor recycling
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 6a595dfebeeb53706b60429bc904095a2ab4cba9..dfed708b59a3b5f8e898e428b98adbc76f55fdf8 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -558,7 +558,11 @@
return;
host()->WasHidden();
- browser_compositor_->SetRenderWidgetHostIsHidden(true);
+ // Consider the RWHV occluded only if it is not attached to a window
+ // (e.g. unattached BrowserView). Otherwise we treat it as visible to
+ // prevent unnecessary compositor recycling.
+ const bool unattached = ![GetInProcessNSView() window];
+ browser_compositor_->SetRenderWidgetHostIsHidden(unattached);
}
void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) {