Skip to content

Commit

Permalink
fix: remove white screen flicker by disabling compositor recycling (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Aug 23, 2019
1 parent dd8bcb6 commit e68a948
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 71 deletions.
2 changes: 1 addition & 1 deletion patches/chromium/.patches
Expand Up @@ -71,10 +71,10 @@ fix_breakpad_symbol_generation_on_linux_arm.patch
frame_host_manager.patch
cross_site_document_resource_handler.patch
crashpad_pid_check.patch
chore_add_debounce_on_the_updatewebcontentsvisibility_method_to.patch
network_service_allow_remote_certificate_verification_logic.patch
put_back_deleted_colors_for_autofill.patch
build_win_disable_zc_twophase.patch
disable_color_correct_rendering.patch
add_contentgpuclient_precreatemessageloop_callback.patch
fix_use_weakptr_to_detect_deletion.patch
fix_disabling_compositor_recycling.patch

This file was deleted.

8 changes: 4 additions & 4 deletions patches/chromium/cross_site_document_resource_handler.patch
Expand Up @@ -22,10 +22,10 @@ index b74bbef56038e29ca35403affd284a7a8868c201..d6887e576ac197f80a7e5261bd251cd7
}

diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 5142cfedf46dafa383f615fe8ca72c1d4c20b36e..691fbc819713beb881402cb8a84886bd0780b106 100644
index 511c839d818fee430132efbd1e53a81f44c458a7..4cee1fc221d96e79b96659081c119a06cc53dfd5 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -71,6 +71,10 @@ std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
@@ -72,6 +72,10 @@ std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
return nullptr;
}

Expand All @@ -37,10 +37,10 @@ index 5142cfedf46dafa383f615fe8ca72c1d4c20b36e..691fbc819713beb881402cb8a84886bd
const base::Location& from_here,
const scoped_refptr<base::TaskRunner>& task_runner,
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 671b2ccfb8f8f21018931c454584d7f0bd2b1418..b5361817676abfdf74cc6cf9a628e18a5aeb3dd8 100644
index 6e745308646bf79a192a0e81e1cf89eece8c21eb..3fda12f1edf9d0586bcab891e4e2a3b8d1218070 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -249,6 +249,9 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -253,6 +253,9 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual std::unique_ptr<BrowserMainParts> CreateBrowserMainParts(
const MainFunctionParams& parameters);

Expand Down
20 changes: 20 additions & 0 deletions patches/chromium/fix_disabling_compositor_recycling.patch
@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Thu, 22 Aug 2019 15:55:08 -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/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
index 59e58d693c971742951434f6582140d9179235f2..135e7a384a560f55e5201f108fe1ac2db621fbca 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -209,7 +209,7 @@
}

void BrowserCompositorMac::SetRenderWidgetHostIsHidden(bool hidden) {
- render_widget_host_is_hidden_ = hidden;
+ render_widget_host_is_hidden_ = false;
UpdateState();
}

2 changes: 1 addition & 1 deletion spec-main/api-browser-window-spec.ts
Expand Up @@ -2463,7 +2463,7 @@ describe('BrowserWindow module', () => {
}
})

it('visibilityState remains visible if backgroundThrottling is disabled', async () => {
it.skip('visibilityState remains visible if backgroundThrottling is disabled', async () => {
const w = new BrowserWindow({
show: false,
width: 100,
Expand Down

0 comments on commit e68a948

Please sign in to comment.