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

Unified Diff: ui/accelerated_widget_mac/io_surface_layer.mm

Issue 1137093003: Mac: Add more trace events for CAOpenGLLayers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix grammar Created 5 years, 7 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 | « content/common/gpu/image_transport_surface_fbo_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accelerated_widget_mac/io_surface_layer.mm
diff --git a/ui/accelerated_widget_mac/io_surface_layer.mm b/ui/accelerated_widget_mac/io_surface_layer.mm
index 7c47294551066edb4ebc3c1771247143c35ae04a..56a6391a99da52496519ce16071c7632b8533a8a 100644
--- a/ui/accelerated_widget_mac/io_surface_layer.mm
+++ b/ui/accelerated_widget_mac/io_surface_layer.mm
@@ -80,16 +80,18 @@ bool IOSurfaceLayerHelper::CanDraw() {
[layer_ setAsynchronous:NO];
}
- // Add an instantaneous blip to the PendingSwapAck state to indicate
- // that CoreAnimation asked if a frame is ready. A blip up to to 3 (usually
- // from 2, indicating that a swap ack is pending) indicates that we
- // requested a draw. A blip up to 1 (usually from 0, indicating there is no
- // pending swap ack) indicates that we did not request a draw. This would
- // be more natural to do with a tracing pseudo-thread
- // http://crbug.com/366300
- TRACE_COUNTER_ID1("browser", "PendingSwapAck", this, needs_display_ ? 3 : 1);
- TRACE_COUNTER_ID1("browser", "PendingSwapAck", this,
- has_pending_frame_ ? 2 : 0);
+ if (needs_display_) {
+ // If there is a draw pending then increase the signal from 2 to 3, to
+ // indicate that we are in the state where there is a swap pending and
+ // CoreAnimation has been committed to draw it.
+ TRACE_COUNTER_ID1("browser", "PendingSwapAck", this, 3);
+ } else {
+ // If there is not a draw pending, then give an instantaneous blip up from
+ // 0 to 1, indicating that CoreAnimation was ready to draw a frame but we
+ // were not (or didn't have new content to draw).
+ TRACE_COUNTER_ID1("browser", "PendingSwapAck", this, 1);
+ TRACE_COUNTER_ID1("browser", "PendingSwapAck", this, 0);
+ }
return needs_display_;
}
« no previous file with comments | « content/common/gpu/image_transport_surface_fbo_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698