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

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

Issue 2079023002: Revert of mac: ensure ui::Compositor exists for visible RWHVs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 68b34768d253b8c8c3a35b4005eec4b18cae408b..6b759cee848fc22a310e525221104b0a0af13b9c 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -597,9 +597,6 @@
->GetInputEventRouter()
->AddSurfaceIdNamespaceOwner(GetSurfaceIdNamespace(), this);
}
-
- if (!render_widget_host_->is_hidden())
- EnsureBrowserCompositorView();
}
RenderWidgetHostViewMac::~RenderWidgetHostViewMac() {
@@ -643,7 +640,6 @@
// RenderWidgetHostViewMac, RenderWidgetHostView implementation:
void RenderWidgetHostViewMac::EnsureBrowserCompositorView() {
- DCHECK(!render_widget_host_->is_hidden());
TRACE_EVENT0("browser",
"RenderWidgetHostViewMac::EnsureBrowserCompositorView");
@@ -720,7 +716,6 @@
// This should only be reached if |render_widget_host_| is hidden, destroyed,
// or in the process of being destroyed.
- DCHECK(!render_widget_host_ || render_widget_host_->is_hidden());
DestroyBrowserCompositorView();
}
@@ -892,18 +887,16 @@
void RenderWidgetHostViewMac::Show() {
ScopedCAActionDisabler disabler;
[cocoa_view_ setHidden:NO];
- if (!render_widget_host_->is_hidden()) {
- DCHECK_EQ(browser_compositor_state_, BrowserCompositorActive);
- return;
- }
-
- WasUnOccluded();
+ 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
// pause will have a frame to wait on.
@@ -924,11 +917,6 @@
// completes. As a result you won't get a thumbnail for the page unless you
// execute these two statements in this specific order.
render_widget_host_->WasHidden();
- // Re-check hidden flag, as the thumbnail generation could have called
- // WasUnOccluded and unhidden itself.
- if (!render_widget_host_->is_hidden()) {
- return;
- }
SuspendBrowserCompositorView();
}
DestroySuspendedBrowserCompositorViewIfNeeded();
@@ -944,7 +932,6 @@
render_widget_host_->GetLatencyComponentId(),
0);
render_widget_host_->WasShown(renderer_latency_info);
- EnsureBrowserCompositorView();
}
void RenderWidgetHostViewMac::WasOccluded() {
@@ -1507,7 +1494,8 @@
gfx::Size dip_size = gfx::ConvertSizeToDIP(scale_factor, pixel_size);
root_layer_->SetBounds(gfx::Rect(dip_size));
- if (browser_compositor_ && browser_compositor_->compositor()) {
+ if (!render_widget_host_->is_hidden()) {
+ EnsureBrowserCompositorView();
browser_compositor_->compositor()->SetScaleAndSize(
scale_factor, pixel_size);
}
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698