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

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

Issue 408103004: Mac: Fix bad framerate when capturing tab (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
Index: content/browser/renderer_host/compositing_iosurface_layer_mac.mm
diff --git a/content/browser/renderer_host/compositing_iosurface_layer_mac.mm b/content/browser/renderer_host/compositing_iosurface_layer_mac.mm
index 3ee962d0788da402ae5be25173e998a8da9a4093..8efa2589f1e9045fe8405065ffba84ad6a589fdc 100644
--- a/content/browser/renderer_host/compositing_iosurface_layer_mac.mm
+++ b/content/browser/renderer_host/compositing_iosurface_layer_mac.mm
@@ -43,23 +43,22 @@ CompositingIOSurfaceLayerHelper::~CompositingIOSurfaceLayerHelper() {
}
void CompositingIOSurfaceLayerHelper::GotNewFrame() {
+ // A trace value of 2 indicates that there is a pending swap ack. See
+ // canDrawInCGLContext for other value meanings.
+ TRACE_COUNTER_ID1("browser", "PendingSwapAck", this, 2);
+
has_pending_frame_ = true;
needs_display_ = true;
timer_.Reset();
- if ([layer_ context] && [layer_ context]->is_vsync_disabled()) {
- // If vsync is disabled, draw immediately and don't bother trying to use
- // the isAsynchronous property to ensure smooth animation.
+ // If reqested, draw immediately and don't bother trying to use the
+ // isAsynchronous property to ensure smooth animation.
+ if (client_->AcceleratedLayerShouldAckImmediately()) {
ImmediatelyForceDisplayAndAck();
} else {
- needs_display_ = YES;
if (![layer_ isAsynchronous])
[layer_ setAsynchronous:YES];
}
-
- // A trace value of 2 indicates that there is a pending swap ack. See
- // canDrawInCGLContext for other value meanings.
- TRACE_COUNTER_ID1("browser", "PendingSwapAck", this, 2);
}
void CompositingIOSurfaceLayerHelper::SetNeedsDisplay() {

Powered by Google App Engine
This is Rietveld 408576698