summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorccameron <ccameron@chromium.org>2015-03-12 15:29:11 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-12 22:30:26 +0000
commit398ff0bdf8f314a6f98d8d7ea348ea89d44aa7b3 (patch)
treec782a97df8da1fe36e2e623131b5a873aea18deb
parent37f9cad0a5a945bda2d4ebfe2217db7711572718 (diff)
downloadchromium_src-398ff0bdf8f314a6f98d8d7ea348ea89d44aa7b3.zip
chromium_src-398ff0bdf8f314a6f98d8d7ea348ea89d44aa7b3.tar.gz
chromium_src-398ff0bdf8f314a6f98d8d7ea348ea89d44aa7b3.tar.bz2
Mac: Don't force an immediate draw during tab-switch
I introduced this behavior in https://codereview.chromium.org/810333005 with the reasoning that by forcing an immediate draw, we will tab-switch faster. That reasoning is still true, but after cleaning up a number of other sources of slow tab-switch, I found that, while this un-blocks tab-switch faster, the window system doesn't like it when these draws are forced. In particular, it will often just flash a blank frame for the remote CALayer. If we were okay with a flash of a blank frame, then we won't do the stall waiting for a frame to begin with. BUG=463988 Review URL: https://codereview.chromium.org/1004513003 Cr-Commit-Position: refs/heads/master@{#320392}
-rw-r--r--content/common/gpu/image_transport_surface_calayer_mac.mm8
1 files changed, 1 insertions, 7 deletions
diff --git a/content/common/gpu/image_transport_surface_calayer_mac.mm b/content/common/gpu/image_transport_surface_calayer_mac.mm
index 50cbaea3..064c277 100644
--- a/content/common/gpu/image_transport_surface_calayer_mac.mm
+++ b/content/common/gpu/image_transport_surface_calayer_mac.mm
@@ -193,11 +193,6 @@ void CALayerStorageProvider::SwapBuffers(
[context_ retain];
}
- // If we create a new layer, always force it to draw immediately. This is
- // especially important at tab-switch, where we don't want to wait for a
- // vsync to un-block the browser (which is waiting for the frame to come in).
- bool force_immediate_draw = false;
-
// Allocate a CALayer to use to draw the content and make it current to the
// CAContext, if needed.
if (!layer_) {
@@ -208,7 +203,6 @@ void CALayerStorageProvider::SwapBuffers(
[layer_ setFrame:CGRectMake(0, 0, dip_size.width(), dip_size.height())];
[context_ setLayer:layer_];
- force_immediate_draw = true;
}
// Replacing the CAContext's CALayer will sometimes results in an immediate
@@ -217,7 +211,7 @@ void CALayerStorageProvider::SwapBuffers(
return;
// Tell CoreAnimation to draw our frame.
- if (gpu_vsync_disabled_ || throttling_disabled_ || force_immediate_draw) {
+ if (gpu_vsync_disabled_ || throttling_disabled_) {
DrawImmediatelyAndUnblockBrowser();
} else {
if (![layer_ isAsynchronous])