| 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..86f5a774225371db85fd1cc8dbf5f64a44489c0e 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,12 @@ void RenderWidgetHostViewMac::Show() {
|
| if (!render_widget_host_->is_hidden())
|
| return;
|
|
|
| + // Re-create the browser compositor. If the DelegatedFrameHost has a cached
|
| + // frame from the last time it was visible, then it will immediately be
|
| + // drawn. If not, then the compositor will remain locked until a new delegated
|
| + // frame is swapped.
|
| + EnsureBrowserCompositorView();
|
| +
|
| WasUnOccluded();
|
|
|
| // If there is not a frame being currently drawn, kick one, so that the below
|
|
|