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 21, 2019
1 parent 46b6bcd commit 50888f0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 66 deletions.
2 changes: 1 addition & 1 deletion patches/chromium/.patches
Expand Up @@ -67,10 +67,10 @@ worker_context_will_destroy.patch
fix_breakpad_symbol_generation_on_linux_arm.patch
frame_host_manager.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_vc_incompatible_inline_calls.patch
disable_compositor_recycling.patch

This file was deleted.

20 changes: 20 additions & 0 deletions patches/chromium/disable_compositor_recycling.patch
@@ -0,0 +1,20 @@
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/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
index 18019d5794f688ca07b35a665cc9800bb1d3047a..60c7e980dd322ba012c564fca68848c3188ca5dc 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();
}

0 comments on commit 50888f0

Please sign in to comment.