From 98f9941843da10b7b2f9cb839d555184f22a8175 Mon Sep 17 00:00:00 2001 From: Felipe Archondo Date: Fri, 6 Mar 2020 11:33:31 -0500 Subject: [PATCH] [fuchsia] fix broken flows when under high load (#16834) --- shell/platform/fuchsia/flutter/session_connection.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shell/platform/fuchsia/flutter/session_connection.cc b/shell/platform/fuchsia/flutter/session_connection.cc index fa2e18e74ea0..63ad94f4ff9b 100644 --- a/shell/platform/fuchsia/flutter/session_connection.cc +++ b/shell/platform/fuchsia/flutter/session_connection.cc @@ -95,14 +95,15 @@ void SessionConnection::Present( flutter::CompositorContext::ScopedFrame* frame) { TRACE_EVENT0("gfx", "SessionConnection::Present"); + TRACE_FLOW_BEGIN("gfx", "SessionConnection::PresentSession", + next_present_session_trace_id_); + next_present_session_trace_id_++; + // Throttle frame submission to Scenic if we already have the maximum amount // of frames in flight. This allows the paint tasks for this frame to execute // in parallel with the presentation of previous frame but still provides // back-pressure to prevent us from enqueuing even more work. if (initialized_ && frames_in_flight_ < kMaxFramesInFlight) { - TRACE_FLOW_BEGIN("gfx", "SessionConnection::PresentSession", - next_present_session_trace_id_); - next_present_session_trace_id_++; PresentSession(); } else { // We should never exceed the max frames in flight.