Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(926)

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 996453002: Allow ui::Compositor to disable commits during tab-switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up version Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
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 7f3cb354dc05c946fc6ce1534b5eb6a1ebcd1fea..1ad6b78dbe409bb5bd4564ffccd12eb7738d33be 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -615,6 +615,14 @@ void RenderWidgetHostViewMac::EnsureBrowserCompositorView() {
if (browser_compositor_state_ == BrowserCompositorSuspended) {
delegated_frame_host_->SetCompositor(browser_compositor_->compositor());
delegated_frame_host_->WasShown(ui::LatencyInfo());
+ // Unsuspend the browser compositor after showing the delegated frame host.
+ // If there is not a saved delegated frame, then the delegated frame host
+ // will keep the compositor locked until a delegated frame is swapped.
+ float scale_factor = ViewScaleFactor();
+ browser_compositor_->compositor()->SetScaleAndSize(
+ scale_factor,
+ gfx::ConvertSizeToPixel(scale_factor, GetViewBounds().size()));
+ browser_compositor_->Unsuspend();
browser_compositor_state_ = BrowserCompositorActive;
}
}
@@ -625,6 +633,9 @@ void RenderWidgetHostViewMac::SuspendBrowserCompositorView() {
// Hide the DelegatedFrameHost to transition from Active -> Suspended.
if (browser_compositor_state_ == BrowserCompositorActive) {
+ // Ensure that any changes made to the ui::Compositor do not result in new
+ // frames being produced.
+ browser_compositor_->Suspend();
// Marking the DelegatedFrameHost as removed from the window hierarchy is
// necessary to remove all connections to its old ui::Compositor.
delegated_frame_host_->WasHidden();
@@ -834,6 +845,7 @@ void RenderWidgetHostViewMac::Show() {
if (!render_widget_host_->is_hidden())
return;
+ EnsureBrowserCompositorView();
danakj 2015/03/12 00:07:15 How come this is needed?
ccameron 2015/03/12 01:01:34 Oh -- I added the explanation to the CL descriptio
danakj 2015/03/12 01:08:50 Thanks :)
WasUnOccluded();
// If there is not a frame being currently drawn, kick one, so that the below

Powered by Google App Engine
This is Rietveld 408576698