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

Unified Diff: content/browser/compositor/browser_compositor_view_private_mac.mm

Issue 388793003: Mac ÜC: Fix white page hangs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/browser_compositor_view_private_mac.mm
diff --git a/content/browser/compositor/browser_compositor_view_private_mac.mm b/content/browser/compositor/browser_compositor_view_private_mac.mm
index fb452fb4c9423ac6822cc3bf633598efb3fec00f..c70e5b49a756a0bbbb979d1e7495b1c7eecba657 100644
--- a/content/browser/compositor/browser_compositor_view_private_mac.mm
+++ b/content/browser/compositor/browser_compositor_view_private_mac.mm
@@ -13,6 +13,10 @@
#include "ui/base/cocoa/animation_utils.h"
#include "ui/gl/scoped_cgl.h"
+@interface CompositingIOSurfaceLayer(Private)
+- (void)immediatelyForceDisplayAndAck;
+@end
+
////////////////////////////////////////////////////////////////////////////////
// BrowserCompositorViewCocoa
@@ -98,6 +102,13 @@
accelerated_latency_info_.insert(accelerated_latency_info_.end(),
latency_info.begin(), latency_info.end());
+ // If the client that wanted to display this frame has disappeared, don't
+ // bother creating the layers, just un-block the compositor and quit.
+ if (!client_) {
+ [self layerDidDrawFrame];
+ return;
+ }
+
// Disable the fade-in animation as the layer is added, removed, or resized.
ScopedCAActionDisabler disabler;
@@ -136,17 +147,16 @@
// Set the bounds of the accelerated layer to match the size of the frame.
// If the bounds changed, force the content to be displayed immediately.
CGRect new_layer_bounds = CGRectMake(
- 0,
- 0,
- [accelerated_layer_ iosurface]->dip_io_surface_size().width(),
- [accelerated_layer_ iosurface]->dip_io_surface_size().height());
+ 0,
+ 0,
+ [accelerated_layer_ iosurface]->dip_io_surface_size().width(),
+ [accelerated_layer_ iosurface]->dip_io_surface_size().height());
bool bounds_changed = !CGRectEqualToRect(
new_layer_bounds, [accelerated_layer_ bounds]);
[accelerated_layer_ setBounds:new_layer_bounds];
if (bounds_changed ||
(client_ && client_->BrowserCompositorShouldDrawImmediately())) {
- [accelerated_layer_ setNeedsDisplay];
- [accelerated_layer_ displayIfNeeded];
+ [accelerated_layer_ immediatelyForceDisplayAndAck];
}
// If there was a software layer or an old accelerated layer, remove it.
@@ -166,6 +176,11 @@
if (!frame_data || !canvas)
return;
+ // If the client that requested frame has disappeared, quit immediately (no
+ // acknowledgement is needed to un-block the software compositor).
+ if (!client_)
+ return;
+
// If there is not a layer for software frames, create one.
if (!software_layer_) {
// Disable the fade-in animation as the layer is added.
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698